File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes jtree navigation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jtree navigation" Watch "jtree navigation" New topic

jtree navigation

rick derringer

Joined: Sep 11, 2006
Posts: 1
hello there,
i have a large jtree on the left, and a mainpanel with a cardlayout on the right. with every node selection, the mainpanel switches to the corresponding card. now i want to provide some browser like histoy back and forward functionality. Does anybody have a nice solution for this ?

Best Regards, Rick
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Of course. You could make up a helper class that will remember a certain number of node selections and/or card indices in an array. When you want to back up just start moving back through the array (or other data structure) for the old selections. Or you can find an old selection by index into the array.
I agree. Here's the link:
subject: jtree navigation
jQuery in Action, 3rd edition