Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

removing components from a JPanel

839609Mar 9 2011 — edited Mar 10 2011
Hello,

I'm making a gui with Swing, and would like you tell me what is the best way to remove all the components has added to a JPanel. I have prove with methods like removeAll(), but in some cases it didn't work at all, so I wonder if maybe the best way to remove all the components i't using the same method, but giving as a parameter the object to remove.
I wonder if maybe if you don't have the reference to an object, it's maybe imposible to remove it.

Thank you very much.

Sorry for my english it's not very good.
This post has been answered by Olek on Mar 9 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2011
Added on Mar 9 2011
6 comments
1,713 views