Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creation of GUI from xml file

 
Avinash Rakkasagi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Avinash Rakkasagi
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe he is pointing you to the tutorial - http://docs.oracle.com/javase/tutorial/uiswing/components/tree.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic