• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving Permanently JTree Hierarchy

 
Naveen Asha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have create a JTree for my application. When I create new Nodes in this JTree, they obviously vanished when I open my application again.
I want to save these newly constructed JTree Nodes hierarchy in database or somewhere else. Please help me!
Thank you,
Naveen
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to make some way for the tree's model to load itself when the program starts and save itself when the program shuts down... I'd use JDOM to save the tree as an XML document, since this models tree structure well, and is pretty easy to do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!