You first have to get the button event. When the button is pressed get the SWING-object of your panel. Remove all components inside and then add the new items. Don't forget to initialize the new components first.
If you have to do dynamic panels very often think about building an XML interface (see
www.jeasy.de; run the Example and select the tabbedpane dynamic container). Is is build 100% dynamically because all GUI components are described in an XML file readed at runtime.
Regards
[ May 28, 2002: Message edited by: Harry Pfohl ]
[ May 28, 2002: Message edited by: Harry Pfohl ]