I need to show an xml as a tree structure in a java swing application. When I click on any node in the swing tree its attribute should list in a window (like a properties editor) and from that I need to update the attributes. Also I need to hide some nodes in the xml in the tree.
I am planning to use JTree
to populate and show the xml as tree. But bit confused about what approach need to take to read/update the xml.
Currently I have the below options:
- Using JAXB create the corresponding objects and populate the JTree
- Use any parser DOM or SAX and populate the JTree using the DefaultMutableTreeNode
Please advice what approach I need to proceed? or is there any other better way for doing this?