Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree and JEditorPane

 
Deyna Cegielski
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ive been implementing a help system that uses a splitpane with a jtree in the left side (which allows the user to navigate to diferent help sections) and a jeditorpane in the right side (which will display the information).

ive setup to jtree with no problems and added the treeselectioneventlistener to listen and respond to changes in selection, but ive become a little unstuck as to how i am going to translate a selection, into loadin the appropriate document into the jeditorpane.

any ideas?

been working on this most of the afternoon there may be an easier way to do this but i have been trying to get the index of the selected node, its parent(if it has one) and its grandparent(if it has one) and so forth...

e.g.

-root1
--node1
--node2
--root2
----node1
----node2

so if the user selects node 2 in root 2 i want to be able to get the index path to the node, i.e 0,2,1 (have my own plans of what i want to do with this path). getting he correct path is proving to be tricky.

any help would be appreciated

[ April 20, 2006: Message edited by: Deyna Cegielski ]
[ April 20, 2006: Message edited by: Deyna Cegielski ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic