🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1527

Re: displaying child nodes on demand

#1527
From: Alan Shiers
Date: Sun, 26 Oct 2003 22:06
33 lines
2387 bytes
Hi there,

Please help me along here.  JTree itself doesn't have a
fireTreeStructureChanged() method nor does my class which implements
TreeModel.  The only thing I could find in the JavaDocs at
http://java.sun.com/j2se/1.4.2/docs/api/

was an interface called TreeModelListener.  It has a declared method called
treeStructureChanged(TreeModelEvent e).  If I am to use this interface
somehow do I implement it in MyTreeModel class or do I subclass JTree and
implement it there?  I'm not quite sure how to set this up right.

Incidentally, I don't have JBuilder any more.  I'm currently just using Sun
One Studio 4.  Hope to purchase JBuilder again someday soon, but money is a
little tight right now. Just using this newsgroup for techical help.

Alan

"Tor Iver Wilhelmsen (TeamB)" <tor.wilhelmsen@ergo.no> wrote in message
news:u3cdgqvx4.fsf@ergo.no...
> "Alan Shiers" <ashiers@hfx.eastlink.ca> writes:
>
> > This method does what it is supposed to, however, once it has
> > populated the parent node, I expected the JTree to display the
> > nodes.  This is not happening.  Can someone please explain how I get
> > the JTree to then display the child nodes.
>
> You need to tell the view. In the model, call
> fireTreeStructureChanged() for the TreePath down to where they were
> inserted.
>
> (To get the fire* methods generated for you, use the BeansExpress
> events tab and click TreeModel in the list of events to fire.)
Technical Details
Message-ID: <3f9c473e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f9ae29b$1@newsgroups.borland.com> <u3cdgqvx4.fsf@ergo.no>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,63f1d22919caaa01
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2003-10-26 14:39:10 PST
From: "Alan Shiers" <ashiers@hfx.eastlink.ca>
Newsgroups: borland.public.jbuilder.java.swing
References: <3f9ae29b$1@newsgroups.borland.com> <u3cdgqvx4.fsf@ergo.no>
Subject: Re: displaying child nodes on demand
Date: Sun, 26 Oct 2003 18:06:48 -0400
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 24.222.101.2
Message-ID: <3f9c473e$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067206462 24.222.101.2 (26 Oct 2003 14:14:22 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail