Article View: borland.public.jbuilder.java.swing
Article #9003Re: Adding Nodes to JTree
From: Greg Hamer
Date: Tue, 30 May 2000 00:00
Date: Tue, 30 May 2000 00:00
36 lines
1429 bytes
1429 bytes
If you use the methods on DefaultTreeModel to add the nodes,(intead of the methods from MutableTreeNode) it will fire the events needed to keep the painting of the tree up to date. Jack Cook <jcook@shellus.com> wrote in message news:392ec497@dnews... > All, > > I have a JTree in which I am programatically adding DefaultMutableTreeNode > subclasses too. > For example > > A > +---B > | > +--C > | > +--D > > C and D or children of B. When I click on B I popup a file selection dialog > and select a file (C). > I add C as a child of B and then do a JTree.expandPath(). If I then try to > click on B and add > another file (D) it appears to work however D never shows up in the tree. I > did notice that if > I never do an expandPath() I can get mutliple children (C&D). > > Any clues as to what my problem might be? > > Thanks, > > Jack > > >
Technical Details
Message-ID:
<8h130u$l5s3@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<392ec497@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,7e7acf512106fddf X-Google-Attributes: gid111d45,public From: "Greg Hamer" <ghamer@corp.netzero.net> Subject: Re: Adding Nodes to JTree Date: 2000/05/30 Message-ID: <8h130u$l5s3@bornews.borland.com> X-Deja-AN: 629127712 References: <392ec497@dnews> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing