Popup menu from jtable
I'm converting a legacy XWindows/Motif gui to Java. I need to have a multi-level popup menu appear when a user selects a cell in the first column. The menu would give choices for that column. How would I associate a jmenu to a column? It needs to be for a single column only and be a left click with the mouse, not a right click. Different columns would have different menus. I did find an old thread in this forum that showed how to do it with a right click. I need to duplicate legacy functionality, though, so I need left click. Here's the previous thread
After further Googleing I found what appears to be the help I need. Here's the sample code.
public void mousePressed(MouseEvent e)
if(e.getButton() == MouseEvent.BUTTON1)
label.setText("Detected Mouse Left Click!");
else if(e.getButton() == MouseEvent.BUTTON3)
label.setText("Detected Mouse Right Click!");