Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kenny Smith
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works, thanks and regards!
 
ramswaroop ram
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Gregg Bolinger.. It really healped me..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic