• Post Reply Bookmark Topic Watch Topic
  • New Topic

storing a UserPreferences for JTree

 
Rishi Yagnik
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
i want to store a userpreferences for jtree in which i will have to show which were the last opened nodes and selected nodes..how do i do that ?
i have stored a opennodes in xml files while retriving how do i show a tree with open nodes...has anybody had done that......
pls let me know it is very urgent.......
Rishi
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
couldn't you just serialize the tree object? I haven't done that yet, but the serialization should preserve the state the tree is in.
or you create a class to store the information which nodes are expanded and which not and serialize an instance of this class. that would be a solution in case the nodes of the tree can change from one application run to the other.
chantal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!