Droezel
asked on
JTree event listener on root node problem
I have a JTree to let the user build folders and items (nodes) interactively. This is done by rightclicking an existing node, a listener then opens a popup with some options... The problem is that I cannot show a popup menu when the user clicks on the ROOT node (wich seems to be default in a JTree). The listener isn't even activated when one clicks the ROOT.
I have a listener attached to the JTree:
tree.addTreeSelectionListe ner(new TreeSelListener()); //when node is selected
tree.addMouseListener(new PopupMenuListener()); //when tree is clicked
Following class is always triggered when a node is clicked, except for the ROOT node :
private class TreeSelListener implements TreeSelectionListener
Any ideas on this one?
I have a listener attached to the JTree:
tree.addTreeSelectionListe
tree.addMouseListener(new PopupMenuListener()); //when tree is clicked
Following class is always triggered when a node is clicked, except for the ROOT node :
private class TreeSelListener implements TreeSelectionListener
Any ideas on this one?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER