JDom -- > JTree

A

Arun Hallan

Hi,

I have so far created a program that takes an xml document and creates
a document object model from it.

My gui includes a JTree, and when a user opens an xml document, the
JTree should show the contents of the xml file, each node being a new
tag etc.

I haven't much idea to go about this tho. I have looked around but
become more confused as i research furthur.

Could someone give me some tips on what i should research, and what
process i should go about.
 
A

atishay kumar

hi arun,
first you need to parse the XML file.. Your XML file will contain A
root Element.. under which you will have categories(which will be nodes
of the JTree).. and each category may have further sub categories(how
many depends on the XML file).
So You need to parse the XML and generate the list of categories.. and
using that you should build the JTree..
cheers
atishay
 
T

The Abrasive Sponge

Arun said:
Hi,

I have so far created a program that takes an xml document and creates
a document object model from it.

My gui includes a JTree, and when a user opens an xml document, the
JTree should show the contents of the xml file, each node being a new
tag etc.

I haven't much idea to go about this tho. I have looked around but
become more confused as i research furthur.

Could someone give me some tips on what i should research, and what
process i should go about.

Oh, cmon, that'd be fun to do!

But if you want here is some code.....

http://www.jdom.org/pipermail/jdom-interest/2001-September/007499.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DOM extension of JTree 2
JDOM 0
Extra Row in JTree 6
Updating JTree When Adding Nodes 2
JTree navigation 1
JTree application 3
JTable within JTree 1
TreeModel 2

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top