Article View: borland.public.jbuilder.java.language
Article #7486Re: JTree: updating the data
From: Torsten Welches
Date: Fri, 15 Jun 2001 07:40
Date: Fri, 15 Jun 2001 07:40
24 lines
1652 bytes
1652 bytes
Mark, how do you change the tree's data? If you change the whole structure of the data (model) you need to call nodeStructureChanged() on your DefaultTreeModel. The model in turn will inform the tree that a repaint is due. Under "normal" conditions you will never need to call repaint yourself. I looked at your snippet and I have the feeling that you are doing "way too much" <g> Calling nodeChanged() or nodeStructureChanged() at the right times should be all that is necessary. reload() does essentially the same for the whole tree. Are multiple threads involved? Torsten "MarkW" <xx@yy.com> wrote: >Hi Torsten, >hereοΏ½s the code: <snip>
Technical Details
Message-ID:
<3b29bbe7$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!fu-berlin.de!news.boerde.de!dnewsReferences:
<3b20c4b1_1@dnews> <3b25b46d$1_2@dnews> <3b25d94e_1@dnews> <3b25faec_2@dnews> <3b272e3d$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,f502df7c4b0a5f8a X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-15 00:45:12 PST From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Sender: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Reply-To: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Subject: Re: JTree: updating the data Newsgroups: borland.public.jbuilder.java.language X-User-Info: 193.158.55.74 193.158.55.74 References: <3b20c4b1_1@dnews> <3b25b46d$1_2@dnews> <3b25d94e_1@dnews> <3b25faec_2@dnews> <3b272e3d$1_2@dnews> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3b29bbe7$1_1@dnews> Date: 15 Jun 2001 00:40:23 -0700 X-Trace: dnews 992590823 207.105.83.65 (15 Jun 2001 00:40:23 -0700) Lines: 24 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!fu-berlin.de!news.boerde.de!dnews