🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to get the object of the JTree

#8298
From: Tor Iver Wilhelmsen
Date: Mon, 02 Oct 2000 00:00
11 lines
984 bytes
"Scott Yaung" <gzscott@21cn.com> writes:

> Hi JavaGuru,
>   In my case ,I use JTree to list a department of a company,but if in the
> same department ,there are two people
> with the same name,the getSelectionPath() return the same result.So how can
> I know which is one been selected by JTree Method?

You need to use a custom TreeNode (or, if you use DMTN, a custom
"userObject") which you can query for some ID, and not just rely on
the toString() description used by the default TreeCellRenderer.
Technical Details
Message-ID: <uhf6vzq4f.fsf@sds.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8r2d51$2la6@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,8dc88ad7f30331e0
X-Google-Attributes: gid111d45,public
From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no>
Subject: Re: How to get the object of the JTree
Date: 2000/10/02
Message-ID: <uhf6vzq4f.fsf@sds.no>
X-Deja-AN: 676527868
Sender: towi@SDSA1761
References: <8r2d51$2la6@bornews.borland.com>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing