Skip to Main Content

New to Java

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!

how to reset a the contents of a JPanel

807601Apr 9 2008 — edited Apr 9 2008
I was just wondering the different ways one could go about resetting a JPanel. That is to clear everything then reload it.
AKA a game of chess where the pieces have already been moved...then on the click of a button the pieces go back to their original starting positions.

I've checked the API and fiddled about with hide(), show(), dispose() and re-adding the contents but to no avail. Well one method sort've worked but my algorithms became un-workable.

Just wondering what the best (most efficient perhaps?) way of going about this would be.

Thank you in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2008
Added on Apr 9 2008
3 comments
792 views