Article View: borland.public.jbuilder.java.swing
Article #9453Re: JTree Node edition
From: John P. McGrath
Date: Wed, 22 Mar 2000 00:00
Date: Wed, 22 Mar 2000 00:00
18 lines
1157 bytes
1157 bytes
On 22 Mar 2000 10:43:07 +0100, Tor Iver Wilhelmsen wrote: > Mustapha Essalihe <essalihe@iro.umontreal.ca> writes: > > > I have a JTree and I want to edit only some nodes and not others, can I > > find methods to allow editing only those I want. > > jtree.setEditable(true) make all nodes editable !. > > Try overriding JTree.isEditable() to test if the selection path > "points" to an editable node or not. You might also try overriding JTree.startEditingAtPath(TreePath). If you do not want the user to be able to edit that pat, just return. Otherwise, call super.startEditingAtPath(TreePath). -- John P. McGrath <JPMcGrath@fast.net> <jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.13436181dc63c5a098981d@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38D7C9FA.BC5B3D86@iro.umontreal.ca> <uu2hz1gt0.fsf@sds.no>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c76e41445cd3c954 X-Google-Attributes: gid111d45,public From: John P. McGrath <JPMcGrath@fast.net> Subject: Re: JTree Node edition Date: 2000/03/22 Message-ID: <MPG.13436181dc63c5a098981d@forums.borland.com> X-Deja-AN: 601160587 References: <38D7C9FA.BC5B3D86@iro.umontreal.ca> <uu2hz1gt0.fsf@sds.no> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing