Article View: borland.public.jbuilder.java.swing
Article #509Collapse a JTree
From: Magnus
Date: Thu, 28 Jul 2005 14:59
Date: Thu, 28 Jul 2005 14:59
26 lines
1605 bytes
1605 bytes
Hi,
I have a problem to "clear my tree".
Typical tree (visible as is):
top --- node1 --- leaf1
| |- leaf2
|
|-- node2 --- leaf3
|- leaf4
User has node1 selected and click a RadioButton.
Now I want to collapse the tree so that top and node1 and node2 are visible.
I have tried with:
TreePath top = tree.getPathForRow(1);
tree.fireTreeCollapsed(top);
tree.setSelectionRow(0);
Problem is that leaf3 & 4 are still visible
If I try with row=0 only top is visible. I then tried to expand on row=1
but nothing happened.
Any hints?
Technical Details
Message-ID:
<42e8f26e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 111d45,ee6bedc9e28b1fb3,start X-Google-Attributes: gid111d45,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Thu, 28 Jul 2005 10:59:14 -0400 From: Magnus <magnus_bjorkman@iwon.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en, sv MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing Subject: Collapse a JTree Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 65.40.239.216 Message-ID: <42e8f26e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1122562670 65.40.239.216 (28 Jul 2005 07:57:50 -0700) Lines: 26 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!news.glorb.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail