| Author |
Right Click List Selection
|
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
Does anyone know how to have the Right Click of a Mouse perform the same function as the Left Click of the mouse when clicking inside a JList. I have a PopupMenu show when I right click on the list, but I have to left click on the item I want to grab before I can right click. I need the item selected on a right click as well as a left click. Thanks
|
 |
lavanya subramanian
Ranch Hand
Joined: Nov 03, 2000
Posts: 52
|
|
hi gregg, try javax.swing.SwingUtilities class JList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent me) { if(SwingUtilities.isRightMouseButton(me)== true) { } } });
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
Yeah, that detects the right mouse click. But it does not select the item in the JList. Only a left click will. I need to find out how to have the right click select the item the same as a left click. But thanks anyway.
|
 |
 |
|
|
subject: Right Click List Selection
|
|
|