1

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:

  1. Using JAXB create the corresponding objects and populate the JTree
  2. 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?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Jijo Mathew
  • 222
  • 1
  • 3
  • 9
  • 1
    It depends, either DOM or SAX would be preferred as it will provide you with the raw information you need and the ability to filter the content as required... – MadProgrammer Aug 21 '14 at 06:03
  • A related example is examined [here](http://stackoverflow.com/q/11841117/230513). – trashgod Aug 21 '14 at 10:08

0 Answers0