This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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..
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!