🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: DefaultMutableTreeNode.setUserObject - newbie question

#12715
From: Joe Fessler
Date: Fri, 06 Nov 1998 00:00
23 lines
1381 bytes
I believe the text for the node comes from the toString() method of the
"UserObject"; so if you change the values that go to make up the String
returned by toString(), it should be reflected in the node text.  You may have
to repaint()/invalidate()/revalidate() (or some such mumbo-jumbo) the JTree to
get the updated values.

Best of luck.

Regards,
-Joe

Carla Kessler wrote:

> I am trying to do the simplest thing with tragic results...I have a JTree
> and I want to change the root node's text string. When I do so, using
> setUserObject, all of the children disappear.
>
> Can anyone tell me what I am doing wrong? I would like to be able to alter
> the text for the node without destroying the children.
>
> Thanks in advance for any help.
>
> Carla
Technical Details
Message-ID: <3643449B.4C77E29C@LocalIP.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <70on40$nb36@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,4fc29c7e6f0e774c
X-Google-Attributes: gid111d45,public
From: Joe Fessler <jfessler@LocalIP.net>
Subject: Re: DefaultMutableTreeNode.setUserObject - newbie question
Date: 1998/11/06
Message-ID: <3643449B.4C77E29C@LocalIP.net>
X-Deja-AN: 409108941
Content-Transfer-Encoding: 7bit
References: <70on40$nb36@forums.borland.com>
To: Carla Kessler <carner@tscnet.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing