Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jtree navigation

 
rick derringer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic