Can I add new AWT components to objects already visible on the screen?
Ans : Yes, you can change your program’s interface as the program is running. Like other Java objects, AWT components can be created on the fly and connected to existing objects. To appear on screen, the component must be added to a container that is already on screen. You also need to invoke validate on the container so that it activates its layout manager to take the new component into account. The validate method lets you control when layouts are recalculated . Following is a code fragment that adds or removes a button from a panel named centerPanel: int buttonCount = 0; Panel centerPanel = new Panel(); void addButton() { ++buttonCount; centerPanel.add(new Button(“button ” + buttonCount)); centerPanel.