Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTree Node selection  RSS feed

 
Ranganath Junpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have built an JTree with the TableModel, now i have this in one split pane. so when i double click the leaf of a node ie a file(.java file) i want to show the contents of that file in another splitpane which has an editorPane, like any ide.
My question is, To achieve this wht listener should be used?

thank you
Regards
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TreeSelectionListener
 
Ranganath Junpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok in that event if i wanna get the path of tht node how to get that.. I used Treepath path=jtree.getSelectionPath(). It gives a list as [/home/jack, /home/jack/.bashrc]. when i select /home/jack/.bashrc. So i just want to acces the .bashrc path.. how to pass it as an URL to the jtextPane.setPage(URL) as the parameter.


Thank you
Regards
 
Michael Dunn
Ranch Hand
Posts: 4632
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!