Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #240

Re: dynamic JTree from XM

From "dhanya" <dhanya@THRWHITE.remove-dii-this>
Subject Re: dynamic JTree from XM
Message-ID <1164772962.662698.218240@j72g2000cwa.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <AxYah.40006$yQ2.1818613@weber.videotron.net>
Date 2011-04-27 15:26 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

Oliver Wong wrote:
> "dhanya" <dhanya.aishwarya@gmail.com> wrote in message
> news:1164715903.818536.289950@l12g2000cwl.googlegroups.com...
> >
> >
> > Thanks Oliver. I have gone thru it. Now i can display my root and first
> > level of parents. I have added a TreeExpansionListener to my tree. I
> > dont know how to get the selected node inside the expanded event
> > function. When i use event.getPath() its displaying the nodes value.
> > For example if my xml is
> > <parent id="1" value=:"red"/>
> >
> > i want to know its a parent. I am getting "red" as while creating the
> > node i have named it using value. Pls help me i this.
>
>     Sorry, I don't understand your question. Can you give a (short) sample
> XML input, a diagram of what your tree looks like now, and what you want it
> to look like?
>
> Here's a technique for drawing tree diagrams in plain text:
>
> |- File
> |  |- New
> |  |- Send Message
> |  |- Save
> |  `- Close
> |- Edit
> |  |- Copy
> |  |- Cut
> |  `- Paste
> `- Help
>    |- Content
>    `- About
>
>     - Oliver


This is my structure

Root
|
|
,.... RED
|    |
|     _Cherry
|     _Wine
|
|
_VIOLET
    _Flower
    _Name
       |
       _Leaf


I have two XML files parent and chile. The parent has only detail abt
parent nodes. When i construct tree i read the parent XML check whether
it has child nodes, if it has i add a dummy node to parent and display.
When the user clicks on the parent node i have to parse child XML, read
child's data and display the corresponding child nodes for the clicked
parent.
I have done the first level i.e displaying dummy nodes. I have
TreeExpansionListener and i can get the parent's name using getpath.
But Wat i get is if i click on RED i get RED as the resukt of getpath,
what i want is i want to know it is a parent node.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

dynamic JTree from XML "dhanya" <dhanya@THRWHITE.remove-dii-this> - 2011-04-27 15:25 +0000
  Re: dynamic JTree from XM "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
    Re: dynamic JTree from XM "dhanya" <dhanya@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
      Re: dynamic JTree from XM "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
        Re: dynamic JTree from XM "dhanya" <dhanya@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
          Re: dynamic JTree from XM "Oliver Wong" <oliver.wong@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000
            Re: dynamic JTree from XM "dhanya" <dhanya@THRWHITE.remove-dii-this> - 2011-04-27 15:26 +0000

csiph-web