🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTree

#8274
From: Johan Forsberg
Date: Wed, 11 Oct 2000 00:00
16 lines
1204 bytes
"Scott Yaung" <gzscott@21cn.com> skrev i meddelandet
news:8rvpob$s96@bornews.borland.com...
> Hi JavaGuru,
>   Here I want to use a tree to display a colmpany tree
> But when I meet some people with the same name
> When I click on the Item ,the getPath return the same
> result ,so what I can do to get which is clicked in fact ?


tree.addTreeSelectionListener(new TreeSelectionListener() {
  public void valueChanged(TreeSelectionEvent e) {
    TreePath tp=e.getNewLeadSelectionPath();
    TreeNode tn=(TreeNode) tp.getLastPathComponent();
  }
});
Technical Details
Message-ID: <8s1i3f$8n214@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8rvpob$s96@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,ca251d41f0acf873
X-Google-Attributes: gid111d45,public
From: "Johan Forsberg" <jfo@SPAMfinansforbundet.SPAMse>
Subject: Re: JTree
Date: 2000/10/11
Message-ID: <8s1i3f$8n214@bornews.borland.com>
X-Deja-AN: 680098855
Content-Transfer-Encoding: 7bit
References: <8rvpob$s96@bornews.borland.com>
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
X-Priority: 3
Content-Type: text/plain; charset="Windows-1252"
Mime-Version: 1.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
Newsgroups: borland.public.jbuilder.java.swing