Problem with JPopupMenu in a JTree

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-07-28T18:22:23Z Indexed on 2010/12/23 20:54 UTC
Read the original article Hit count: 207

Filed under:
|

Hi guys I have this issue. In a custom JTree I implemented a JPopupMenu to display different JMenuItem according to the node selected using a MouseListener. The JPopupMenu is shown when the mouse right button is clicked. The problem is that if I don’t choose an Item from the PopupMenu but instead I select another node in the tree, either with right or left buttons, this event is never caught by the tree MouseListener Could anyone point me in the right direction to solve this? In case an example is available I’ll appreciate it. Thanks.

© Stack Overflow or respective owner

Related posts about jtree

Related posts about jpopupmenu