Article View: borland.public.jbuilder.java.swing
Article #9489Re: JTree Node Editing problem
From: John P. McGrath
Date: Tue, 28 Mar 2000 00:00
Date: Tue, 28 Mar 2000 00:00
23 lines
1235 bytes
1235 bytes
On Sun, 26 Mar 2000 23:05:00 -0500, Mustapha Essalihe wrote:
> For my problem with editing only some tree nodes and not alls,
> we can override the method JTree.startEditiongAtPath(TreePath)
> or JTree.isEditable(), can anyone explain more or give me an
> example please.
I have not tried this, but I presume it will work. Try overriding the
startEditingAtPath() method, with something like this:
public void startEditingAtPath( TreePath path ) {
if ( canEdit( path ) ) {
super.startEditingAtPath( path );
}
}
Then write a canEdit(TreePath) method that will determine whether the
user should be allowed to edit the node specified by the TreePath.
--
John P. McGrath
<JPMcGrath@fast.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.134a11acd967791c989830@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<38DEDDEC.8921263D@iro.umontreal.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,d61ffa99094667c2 X-Google-Attributes: gid111d45,public From: John P. McGrath <JPMcGrath@fast.net> Subject: Re: JTree Node Editing problem Date: 2000/03/28 Message-ID: <MPG.134a11acd967791c989830@forums.borland.com> X-Deja-AN: 603284966 References: <38DEDDEC.8921263D@iro.umontreal.ca> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing