🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JLabel.remove() method

#9895
From: Tor Iver Wilhelmsen
Date: Thu, 30 Dec 1999 00:00
17 lines
1316 bytes
Alan Shiers <jshiers@istar.ca> writes:

> If this method is supposed to remove something from a component,
> which is acting as a container, how does one specify which component
> within the container is to be removed?

Use the component. The problem is that not all JComponents have any
components inside them, but JComponent extends Container presumably to
have the most wide-ranging base component possible.

> Take the JLabel for instance.  It can contain two things: text and an
> icon.  If I want to remove either of those from the JLabel how is it done
> with the remove(Component c) method?

It isn't, since neither the text nor icon are put into the label using
add(). They are properties, and get painted onto the component's
background, as is common for Swing components in general.
Technical Details
Message-ID: <u3dsk7u2b.fsf@sds.no>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <38691920.18787F2F@istar.ca> <uvh5iqfxr.fsf@sds.no> <386A6094.5F596F35@istar.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,da4570d1bb8d66fa
X-Google-Attributes: gid111d45,public
From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no>
Subject: Re: JLabel.remove() method
Date: 1999/12/30
Message-ID: <u3dsk7u2b.fsf@sds.no>
X-Deja-AN: 566419802
Sender: towi@SDSA1761
References: <38691920.18787F2F@istar.ca> <uvh5iqfxr.fsf@sds.no> <386A6094.5F596F35@istar.ca>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing