aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes  how to implement -- click right botton to select a JTree's node? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark " how to implement -- click right botton to select a JTree Watch " how to implement -- click right botton to select a JTree New topic
Author

how to implement -- click right botton to select a JTree's node?

Kenny Smith
Greenhorn

Joined: Jan 08, 2002
Posts: 9
In the default case, you can select a node by click the left botton.
But how to implement -- click right botton to select a JTree's node?
Thanks.


Kenny Smith
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6


The only other check I do after that is
if (selectedNode.isLeaf()) because I implement a JPopup Menu but only on a Leaf.
Hope that helps.
BTW - Forgot to mention that I do this in the mouseClicked(MouseEvent me) method of my mouse listener I have registered on my JTree.
[ February 12, 2003: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Kenny Smith
Greenhorn

Joined: Jan 08, 2002
Posts: 9
It works, thanks and regards!
ramswaroop ram
Greenhorn

Joined: Oct 25, 2011
Posts: 8
Thanks Gregg Bolinger.. It really healped me..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to implement -- click right botton to select a JTree's node?