• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to set hyperlink to JTree leaf nodes?  RSS feed

 
sridhar bvap
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all,i want to set hyperlink to JTree leaf nodes.what finnally i want is, when i place a mouse on leaf node text, hand symbol has to come.After selecting that particular node,i need to call a JDioalog having content of that selected node.
Any one please help me....
thank you one and all.
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a subclass of javax.swing.event.MouseInputAdapter (or an implementation of javax.swing.event.MouseInputListener). Override mouseClicked for handling the click on the leaf, and mouseMoved to set / change the cursor.

Use the JTree's getPathForLocation method to get the path the mouse is over at that moment.

The following could do what you want:

It's not tested however.
 
sridhar bvap
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Prime, it's working.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!