File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree - explicitly select a node

 
Deyna Cegielski
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my help interface consists of a split pane with a jtree on the left and a jeditorpane on the right.

clicking on a node in the tree heirarchy loads the relevant page into the editorpane

ive added a toolbar that lets you move back and forward through your visited page history (similar to ie). the problem is the last node selected before you start using the back and forward buttons remains selected throughout.

is there a method that explicitly highlights a particular node item, so when a user clicks back, the node that is highlighted becomes deselected and the node whos page has just loaded becomes highlighted.

thanks
[ April 21, 2006: Message edited by: Deyna Cegielski ]
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the JTree api there are a number of methods that will change the selection state, egs, setSelectedRow, removeSelectionRow, setSelectionPath, cancelSelection.
 
Deyna Cegielski
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i must have missed those, pinpointing the method your after cna be quite tricky at times
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic