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
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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
Ranch Hand

Joined: Jul 11, 2001
Posts: 15230


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 ]
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?
 
Similar Threads
Help me ,immediately !!!!
StarUML - Adding tagged values in deployment diagram
JTree row selection by mouseclick question
NX: mnemonics problem in windows XP
[JTree]Block event?