简体   繁体   中英

Java: visual xml editor and tree visualizer swing component I can embed into my application?

Is there a open source or commercial component for a visual xml tree editor? It should parse an xml file and allow the user to easily edit nodes, attributes etc.

Basically, user also needs to be able to add nodes in real time.

The Eclipse editor have a pretty good xml editor. It can show xml in source and in tree-like view. http://www.eclipse.org/

Well, you can write one by your self. Just parse the file and you can use a JTreeTable (swingx) to render it and manipulate it dynamically.
You can see this post:
java-lib for xml tree visualization
The answer by Kumar has an example on how to proceed

Here is the excellent article for generating a tree view structure based on the given xml file on the fly.

http://www.developer.com/xml/article.php/3731356/Displaying-XML-in-a-Swing-JTree.htm

once the tree structure is generated you have to write your own logic to edit , add nodes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM