I have a Jtree which on right click will show a pop up menu.
The problem is when i select any node in the tree with a left click and the right click anywhere in the frame that holds the JTree the pop up menu is Displayed.
I Want to display this pop up menu only when i right click on the selected Node in the JTree.
What am i to do to make this pop up work as intended ??
The pop up appears when right clicked anywhere in the scroll pane containing the JTree.
I am able to make the pop up appear only when right clicked on the node by using the mouseevent getx(), gety() and the components bound.
But i want to know if there are any alternative way for doing the same.