Adding and Removing Controls:
For involve a control in a window, you must have to add it to the window. For do this, you must first create an object of the desired control and then add it to a window via calling add(). That does Container defines. The add () method has various forms.
Component add(Component compobj)
Above, compobj is an object of the control which you need to add. A reference to compobj is returned. Once a control has been added, it will automatically be visible when, its parent window is displayed. Assume, you will require removing a control from a window whenever the control is no longer needed. To do this, call remove().That method is also defined through Container.
It has this common form:
Void remove(Component obj)
Above, obj is a reference to the control you required to remove. You could remove all controls through calling removeAll().