JDom -- > JTree

Discussion in 'Java' started by Arun Hallan, Dec 22, 2004.

  1. Arun Hallan

    Arun Hallan Guest

    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.
    Arun Hallan, Dec 22, 2004
    #1
    1. Advertising

  2. 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
    atishay kumar, Dec 22, 2004
    #2
    1. Advertising

  3. Arun Hallan wrote:

    > 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
    The Abrasive Sponge, Dec 23, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pavel
    Replies:
    1
    Views:
    3,131
    Pavel
    Jul 25, 2003
  2. Wendy S
    Replies:
    1
    Views:
    6,332
    Darren Davison
    Aug 5, 2003
  3. Bernd Oninger
    Replies:
    4
    Views:
    12,207
    GIMME
    Jun 21, 2004
  4. Tinker
    Replies:
    4
    Views:
    5,264
    Harry Bosch
    Oct 9, 2005
  5. Bernd Oninger
    Replies:
    3
    Views:
    2,864
    GIMME
    Jun 21, 2004
Loading...

Share This Page