🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTree problem - adding nodes after root is displayed

#12263
From: Tom Ranz
Date: Mon, 08 Feb 1999 00:00
28 lines
1465 bytes
Torgeir,

Thanks for the reply. However, after trying ideas based on your suggestion
(which seems like it should work) I have not had any success. If you have
sample code that demonstrates your suggestion it may help me figure out what I
am doing wrong.

Tom


Torgeir Veimo wrote:

> Tom Ranz wrote:
> >
> > Hi,
> >
> > I have noticed when trying to add child nodes to an existing and
> > displayed root node multiple times that the new child nodes are added to
> > the root node but I cannot get them to display.
>
> You must inform the tree model that nodes were inserted. Use the
> fireTreeNodesInserted or something similar on either
> DefaultMutableTreeModel or DefaultTreeModel. You can get the model if
> you created the JTree with a node by using getModel() on the JTree
> instance I believe.
>
> --
> -Torgeir
Technical Details
Message-ID: <36BF76DE.3DDF6F4D@mindspring.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <36BF42DD.6CAA7C6A@mindspring.com> <36BF7370.6E0F3DFA@vertech.no>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,b6c9cb4d911d55be
X-Google-Attributes: gid111d45,public
From: Tom Ranz <teranz@mindspring.com>
Subject: Re: JTree problem - adding nodes after root is displayed
Date: 1999/02/08
Message-ID: <36BF76DE.3DDF6F4D@mindspring.com>
X-Deja-AN: 442209463
Content-Transfer-Encoding: 7bit
References: <36BF42DD.6CAA7C6A@mindspring.com> <36BF7370.6E0F3DFA@vertech.no>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing