Article View: borland.public.jbuilder.java.language
Article #7513Re: JTree: updating the data
From: MarkW
Date: Mon, 18 Jun 2001 08:44
Date: Mon, 18 Jun 2001 08:44
40 lines
2328 bytes
2328 bytes
Hi Torsten, it�s getting weirder the more i experiment!! I�ve got my own renderer for the tree and when i use System.out(item.getTitle()) to look at the titles of the data in the tree the tree update works fine and shows the titles of the data. But when i remove the System.out(..) the titles disappear when i update!! At the moment i just replace the tree datamodel using tree.setModel(..) to update the tree as i receive the data in xml-format and generate a tree-model from the xml-data. There aren�t any threads currently involved. Any ideas?? Cheers, Mark "Torsten Welches" <torsten.welches@who.cares.netcologne.de> schrieb im Newsbeitrag news:3b29bbe7$1_1@dnews... > > 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:
<3b2dbf66$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!netnews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3b20c4b1_1@dnews> <3b25b46d$1_2@dnews> <3b25d94e_1@dnews> <3b25faec_2@dnews> <3b272e3d$1_2@dnews> <3b29bbe7$1_1@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-18 02:01:56 PST From: "MarkW" <xx@yy.com> Newsgroups: borland.public.jbuilder.java.language References: <3b20c4b1_1@dnews> <3b25b46d$1_2@dnews> <3b25d94e_1@dnews> <3b25faec_2@dnews> <3b272e3d$1_2@dnews> <3b29bbe7$1_1@dnews> Subject: Re: JTree: updating the data Date: Mon, 18 Jun 2001 10:44:50 +0200 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 149.225.178.67 Message-ID: <3b2dbf66$1_2@dnews> X-Trace: dnews 992853862 149.225.178.67 (18 Jun 2001 01:44:22 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!netnews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews