Controls in java.awt package: add, remove methods

Control is a way for applying user interaction in applications in java.awt package. As the name suggests, by the help of controls a user can control the application. For aligning controls, a layout manager is used which automatically positions the controls.

Types of controls in java.awt package: list, choice list, label, push button, check box, text editing, and scroll bar.

To add a control in a frame window, add( ) method is used:

Component add(Component cob)

where, cob is a component object.

To add a control in a frame window, remove( ) method is used:

void remove(Component ob)

Leave a Reply