Article View: borland.public.jbuilder.java.swing
Article #12996Re: How to show multi-line in JTree
From: Torgeir Veimo
Date: Mon, 05 Oct 1998 00:00
Date: Mon, 05 Oct 1998 00:00
17 lines
1075 bytes
1075 bytes
Jia Zhang wrote: > > I have a problem of how to show multi-line label in JTree. So far for > each node in the JTree, we can only have one line of characters. How can > I show multi-lines of information for some nodes? Any help will be > highly appreciated. Try this: set the height of each node in the tree to be dynamic with setHeight(0) on JTree. Then use a custom cell renderer to render multiline text. It must return proper getPrefferedSize(). I haven't tried it myself though, and YMMV. -- -Torgeir
Technical Details
Message-ID:
<3618AB61.E500F33@vertech.no>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36180E2B.2A769838@eecs.uic.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c864b83646b94d6c X-Google-Attributes: gid111d45,public From: Torgeir Veimo <torgeir.veimo@vertech.no> Subject: Re: How to show multi-line in JTree Date: 1998/10/05 Message-ID: <3618AB61.E500F33@vertech.no> X-Deja-AN: 397849976 Content-Transfer-Encoding: 7bit References: <36180E2B.2A769838@eecs.uic.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: SevenMountains AS Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing