Hello, I have a simple JTree and i wish for a new window to popup when I double click on a node in the tree. Could someone please aid me in learning how this could be done? All help is greatly appreciated. The result would look much like say, a contact list for ICQ, where the nodes are the groups, and the leafs are the contacts. Like ICQ, i want a box to popup on doubleclick (and only a double click) for the selected Jtree leaf. I registered a mouseListener and tree selection listener but there doesn't seem to be any type of listener for double clicks on tree elements. Thanks Oliver
In your mouse listener, in mousePressed(MouseEvent e) method do this: if (e.getSource() instanceof MyTree) Inside this if, check for if (e.getClickCount() == 2) This way you can check for double-clicks in your tree. - Raja.