Article View: borland.public.jbuilder.java.language
Article #8068Re: JTrees -- how to programmatically expand one?
From: Torsten Welches
Date: Mon, 23 Apr 2001 17:54
Date: Mon, 23 Apr 2001 17:54
32 lines
1605 bytes
1605 bytes
Ken, try: tree.setSelectionPath(new TreePath(node.getPath())); you need to setExpandsSelectedPaths(true), which is the default anyway I guess. Torsten Ken Warner schrieb in Nachricht <3AE43B8F.1729735A@cts.com>... >Hi, > >I have a JTree in a JScrollPane. It is a three level pain -- ooops -- I >mean tree. > >I want to expand to a particular node. I know what node I want to >expand to. >How do I use that node to expand the tree? The tree starts completely >collapsed >so that only the root node is showing. There are 9 "middle" nodes and >those >9 middle nodes can have from 0 to 200 leaf nodes. > >I want to expand the tree to a particular leaf node. > >Pointers? Thoughts? *CODE*? > >-- >Ken Warner > >
Technical Details
Message-ID:
<3ae46ba3_1@dnews>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3AE43B8F.1729735A@cts.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,942cde4f8053c1d0 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-23 11:16:03 PST From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Newsgroups: borland.public.jbuilder.java.language References: <3AE43B8F.1729735A@cts.com> Subject: Re: JTrees -- how to programmatically expand one? Date: Mon, 23 Apr 2001 19:54:18 +0200 Lines: 34 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 NNTP-Posting-Host: 213.168.89.157 Message-ID: <3ae46ba3_1@dnews> X-Trace: dnews 988048291 213.168.89.157 (23 Apr 2001 10:51:31 -0700) Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews