Normand Briere
2019-10-20 49d9c15d375942997692f7fccfb697665d0cb59e
cTree.java
....@@ -20,7 +20,12 @@
2020 {
2121 public void mousePressed(MouseEvent e)
2222 {
23
- if (e.isPopupTrigger()) {
23
+ //if (e.isPopupTrigger()) // Works only on mouse released on Windows.
24
+ if (e.getModifiers() == InputEvent.BUTTON3_MASK)
25
+ {
26
+ int row = getClosestRowForLocation(e.getX(), e.getY());
27
+ if (!isRowSelected(row))
28
+ setSelectionRow(row);
2429 popup.show((JComponent) e.getSource(), e.getX(), e.getY());
2530 }
2631 }