How to transform JTree's TreePath in XML?

Users posting here suggested saving TreePath of a JTree

in a vector. My requirement is to save the state of

a JTree (e.g. which nodes are expanded and which not

expanded) in XML and maintain the JTree state across

multiple login sessions. Can anyone please drop me

a clue on how to do it ?

Thank you

Murthy

[355 byte] By [murthy64a] at [2007-10-2 5:39:32]
# 1

Basically you just need a list containing the identifier for each node and whether it's expanded or not. You don't need XML for that but there's nothing wrong with using XML for a list.

You do have a code that uniquely identifies each node in the tree, I hope? Without that your task will be much more difficult.

DrClapa at 2007-7-16 1:49:51 > top of Java-index,Desktop,Core GUI APIs...
# 2
Dr.ClapCould you please post some code on how to do it?Thank youMurthy
murthy64a at 2007-7-16 1:49:51 > top of Java-index,Desktop,Core GUI APIs...
# 3
Dr.ClapI am trying to implement the following algorithm-get all the nodes of the tree-for each nodeif the node is in the XML set the node as visible and expand all the nodesbetween the root and this nodePlease help me out!Thank you
murthy64a at 2007-7-16 1:49:51 > top of Java-index,Desktop,Core GUI APIs...