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 fresh - save previous state? 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 fresh - save previous state?" Watch "JTree fresh - save previous state?" New topic

JTree fresh - save previous state?

Herbert Kornfeld
Ranch Hand

Joined: Apr 16, 2003
Posts: 32
I have a JTree in one view that a user can click on etc. The user can go into a different view and edit data that will effect the tree like the adding, deleting and renaming of nodes. When the user comes back to the initial view I need to refresh the tree because, as I mentioned, nodes could have been added, deleted or renamed but I would like to show the tree in the same state it was before - i.e. the same things selected (if they hadn't been modified, of course) and the same way the tree was expanded from before.
Does anyone has some sample code - or a good strategy to do this - as I think it is a typical problem.
Many Thanks!
I agree. Here's the link:
subject: JTree fresh - save previous state?
It's not a secret anymore!