🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTree update problems

#12767
From: Ross M. Dukeshier
Date: Sat, 14 Nov 1998 00:00
26 lines
1894 bytes
Martin Steger wrote:
> 
> Hi there
> 
> I've a big Problem with updating my JTree from the swing Package. I've
> created my own Treemodel and with this Treemodel I've createt my JTree.
> My big Problem is, to make the changes in the model visible in the
> JTree. I tried a view methods from JTree, but nothing works. When a
> change is made in the model, I'm fireing a Event to a AbstractTreeModel
> and this one passes this to a TreeModelListener. This one try to update
> the tree, but with no result. I tried to do that since two days.
> 
> Has anybody a good example, or the solution for this problem.
If you're adding/removing nodes to/from the Jtree using the methods
provided, I seem to remember that both worked (added the element to the
tree), but that one or the other wouldn't update the picture depending
on what you were doing or how you did it.  I know that sounds ambiguous,
but it's been a while since I had this one.  Try using the methods from
the model and if that doesn't work, try using the method from the
DefaultMutableTreeNode.  I think the model one was the one that ended up
working right, so, if you're using your own model, you may be overriding
the only one that worked...

Hope it helps.

Ross Dukeshier
Technical Details
Message-ID: <364D2979.7B2E@flash.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6v24o7$3kh7@forums.borland.com> <01bdedfc$b93bfde0$2dd96fc2@pc12.gordion.com> <363F61A0.5BDB169D@hsr.ch>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,d70978371e769ca6
X-Google-Attributes: gid111d45,public
From: "Ross M. Dukeshier" <dukeman@flash.net>
Subject: Re: JTree update problems
Date: 1998/11/14
Message-ID: <364D2979.7B2E@flash.net>
X-Deja-AN: 411718813
Content-Transfer-Encoding: 7bit
References: <6v24o7$3kh7@forums.borland.com> <01bdedfc$b93bfde0$2dd96fc2@pc12.gordion.com> <363F61A0.5BDB169D@hsr.ch>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Reply-To: dukeman@pop.flash.net
Newsgroups: borland.public.jbuilder.java.swing