|
-
Dec 16th, 2001, 11:33 PM
#1
Thread Starter
Hyperactive Member
refesh for SWING?
when i remove components from a SWING container i still see them, is there a refresh or repaint or update method i should call? i've checked the api but all the methods i found reuiqre a graphics paramether and for the life of my i wouulddn't know what to pass to it
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Dec 17th, 2001, 12:00 AM
#2
Dazed Member
Which method are you using? Just Curious
public void remove(int index);
public void remove(Component comp)
public void removeAll();
Two things you want to take into consideration with working in swing. 1.) You may need to call invalidate() if you make changes to the appearance of a displayed component. 2.) You must call validate() on Containers that have been invalidated(typically by the addition or invalidation of a child).
The invalidate() method is typically called on a Container to indicate that it's children need to be laid out, or on a Component to indicate that it needs to be re-rendered. Usually this method is called automatically but ive seen situations where this fails to take place (for instance when changing the size of a JButton by changing it's label or font.) In this case you must call invalidate() on the Component to mark it as invalid and validate() must be called on the Container().
Last edited by Dilenger4; Dec 17th, 2001 at 12:16 AM.
-
Dec 17th, 2001, 11:08 AM
#3
Thread Starter
Hyperactive Member
i tried both remove (Component) and i tried removeAll()
as a thought you MUST be able to clone user(?) defined classes because all classes are fundamentally user-defined unless specifically in the JVM like arrays or something.
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|