Article View: borland.public.jbuilder.java.swing
Article #9883JLabel.remove() method
From: Alan Shiers
Date: Tue, 28 Dec 1999 00:00
Date: Tue, 28 Dec 1999 00:00
18 lines
1373 bytes
1373 bytes
Hi there:
I have a small problem regarding the remove(Component c)
method. I've created a class that extends JLabel and called it's
constructor that sets up both text and an icon. What I wanted to do next
was remove the text and icon. Removing the text was easy by calling the
setText("") method with a blank string. There is also a setIcon() method
which I called to set the image like so: setIcon(new
ImageIcon("C:\\temp\\smile.gif")) I was able to use the same method but
with a blank string to also remove the icon image: setIcon(new
ImageIcon("")), but I don't think this is how were supposed to remove
the icon image, is it? I wanted to make use of the remove(Component c)
method but don't know how to. I tried using removeAll() but that did
nothing! How come the removeAll() method didn't work? How do I specify
to my class that I want to remove the icon?
Alan
Technical Details
Message-ID:
<38691920.18787F2F@istar.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,da4570d1bb8d66fa,start X-Google-Attributes: gid111d45,public From: Alan Shiers <jshiers@istar.ca> Subject: JLabel.remove() method Date: 1999/12/28 Message-ID: <38691920.18787F2F@istar.ca> X-Deja-AN: 565770578 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing