Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #282
| From | "dhanya" <dhanya@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: dynamic JTree from XM |
| Message-ID | <1164964156.348406.53030@j72g2000cwa.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <a0hbh.76077$yQ2.2782573@weber.videotron.net> |
| Date | 2011-04-27 15:26 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui Oliver Wong wrote: > "dhanya" <dhanya.aishwarya@gmail.com> wrote in message > news:1164772962.662698.218240@j72g2000cwa.googlegroups.com... > > > > 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. > > I'm still a bit confused. You have exactly two XML files, one parent > file and one child file? Or you have two types of XML files, with probably > one file of the "parent" type, and many files of the "child" type? > > If you just need to know whether a node came from one file or the other, > why don't you store this information with the nodes, or perhaps in a > Map<Node,File>? Or if you always know that parents are at 1 depth below the > root, why don't you just try going up 1 level, checking if what's there is > the root, and if so, then you have a so-called "parent" node, otherwise you > have a so-called "child" node? > > - Oliver Hi Oliver, Thanks for ur reply. I have achieved what i wanted to do. Thanks for ur patience. Regards, Dhanya --- * 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 | Next — Previous in thread | Find similar
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