Adding/Removing Panels

C

christopher_board

I am trying to add and remove panel in Java. I have a main application
screen with a panel added to the contentPane. This works without any
problems. When I click a button in the added panel it should remove
this panel and add a different one. How do I do this. Any help would be
apreciated. Thank you
 
E

Ed

(e-mail address removed) skrev:
I am trying to add and remove panel in Java. I have a main application
screen with a panel added to the contentPane. This works without any
problems. When I click a button in the added panel it should remove
this panel and add a different one. How do I do this. Any help would be
apreciated. Thank you

You've to remove the old panel, add the new one, and re-draw the
container.

See drawPanel() at:
http://www.edmundkirwan.com/servlet/fractal/cs1/code/package29.html#drawPanel

Which calls pokerFrame.setTablePanel() and pokerFrame.redraw().

Bit of a heavy-handed approach, I suppose ...

..ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top