🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

jTree -Problem

#10477
From: Thomas Reck Guggenberger
Date: Tue, 05 Oct 1999 00:00
20 lines
1246 bytes
hi ,
i'm using the JTree and its necessary for me that 
i can set the focus of the treenode by a method of my
class.
JTree offers the method jTree.setSelectionPath(TreePath path);
With path.toString() i get a String like this:
"[root, first_child, second_child]" of the selected path.
How could i manage it to set the node as focused node if i have the
path wich i want to select by code just as a string like :
"[root, first_child";

I tried it with Object gh = "[root, firstchild]";
		TreePath tp = (TreePath) gh;
		jTree.setSelectionPath(tp);
but get a casting error-exception.

Thanks for any solutions.

Ciao Thomas
Technical Details
Message-ID: <37F9BDB6.12569CF1@transcom.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,aa25cc672eb510ef,start
X-Google-Attributes: gid111d45,public
From: Thomas Reck Guggenberger <reck@transcom.de>
Subject: jTree -Problem
Date: 1999/10/05
Message-ID: <37F9BDB6.12569CF1@transcom.de>
X-Deja-AN: 532985658
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@de.uu.net
Organization: Customer of UUNET Deutschland GmbH, Dortmund, Germany
Mime-Version: 1.0
NNTP-Posting-Date: 5 Oct 1999 07:56:47 GMT
Newsgroups: borland.public.jbuilder.java.swing