• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree getting mouse click and present a customer panel  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
G'Day,
How do I capture mouse click event from JTree
I tried e.getSource() == tcr
where tcr is a DefaultMutableTreeNode
to no avail
Thanks
Jack
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The API docs almost always have an associated "How to use xxx". I strongly recommend you read them.
Check out the relevant selection section from http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html#select
Remember, the user can select any node without the mouse.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!