aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Creation of GUI from xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Creation of GUI from xml file" Watch "Creation of GUI from xml file" New topic
Author

Creation of GUI from xml file

Avinash Rakkasagi
Greenhorn

Joined: Nov 24, 2011
Posts: 8
Hi,

I have an xml file containing a list of items as-

My question is: How do I code in java in order to display this in a tree structure in a GUI?
It should be displayed as:

Added to it, there should be an option to expand and compress the contents of the tree also.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Hi Avinash, and welcome to the Ranch!

You would need to load the data into a TreeModel and display it using a JTree. You can read more about using JTree in the tutorial linked from its API.


luck, db
There are no new questions, but there may be new answers.
Avinash Rakkasagi
Greenhorn

Joined: Nov 24, 2011
Posts: 8
Darryl Burke wrote:Hi Avinash, and welcome to the Ranch!

You would need to load the data into a TreeModel and display it using a JTree. You can read more about using JTree in the tutorial linked from its API.


@ Darryl Burke: Could you be more specific, I am new to Java programming. Thanks in advance.
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
I believe he is pointing you to the tutorial - http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creation of GUI from xml file