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
christopher_board@yahoo.co.uk 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
--
www.EdmundKirwan.com - Home of The Fractal Class Composition.
Download Fractality, free Java code analyzer:
www.EdmundKirwan.com/servlet/fractal/frac-page130.html