🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Complex nodes ina JTree

#9384
From: Tamy Staub
Date: Mon, 03 Apr 2000 00:00
40 lines
2086 bytes
Hello,

I just ran across a discussion of this very issue in the book, "Graphic Java
Mastering the JFC VOlume II: Swing" -3rd Edition, from Sun Microsystems
Press, on page 1338.  They have a JTree that has a check box in the node,
instead of the radio button you are using.  Here is the relevant paragraph:
(Follows a section on DefaultTreeCellRenderer)

"It should be noted that the check box rendered by the custom renderer
cannot be manipulated because renderers use components as a stamp to render
cells. In other words, the check box is not actually added to the tree and
therefore cannot be selected or deselected.  If the check box is to be
manipulated, the tree must be fitted with a custom editor, as illustrated in
"rendering and Editing: A Case Study" on page 1354. "

I would recommend getting this excellent book to help you work out the
problem. It has a very lengthy chapter on JTrees.

Hope this helps!
Tamy

Thomas Bonk wrote in message <8bf6u9$f81@bornews.borland.com>...
>Hello,
>
>I currently work on an application that has a JTree as the central
>widget.
>The nodes in that JTree may be rather complex, e.g. they may contain
>JRadioButtons. Now when the users presses the mouse button over a
>node's JRadioButton, the node itself  becomes selected but the event
>isn't being passed on to the JRadioButton.
>
>Does anybody has any hint how I can solve this problem?
>
>I already had a look at the Swing reference and the Java tutorial but
>I didn't find anything in order to solve this problem.
>
>Thanks in advance.
>bye, Thomas
>
>
Technical Details
Message-ID: <8cats2$dh09@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8bf6u9$f81@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,98abf327b24ae051
X-Google-Attributes: gid111d45,public
From: "Tamy Staub" <tamy.staub@trw.com>
Subject: Re: Complex nodes ina JTree
Date: 2000/04/03
Message-ID: <8cats2$dh09@bornews.borland.com>
X-Deja-AN: 606223031
References: <8bf6u9$f81@bornews.borland.com>
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing