Java's Basic User Interface Components - Adding a Control to a Container
(Page 2 of 10 )
In order to add a control to a container, you need to perform the following two steps.
Create an object of the control by passing the required arguments to the constructor.Add the component (control) to the container.
Controls in Java
| Controls | Functions |
| Textbox | Accepts single line alphanumeric entry. |
| TextArea | Accepts multiple line alphanumeric entry. |
| Push button | Triggers a sequence of actions. |
| Label | Displays Text. |
| Check box | Accepts data that has a yes/no value. More than one checkbox can be selected. |
| Radio button | Similar to check box except that it allows the user to select a single option from a group. |
| Combo box | Displays a drop-down list for single item selection. It allows new value to be entered. |
| List box | Similar to combo box except that it allows a user to select single or multiple items. New values cannot be entered. |
Classes Involved
| Controls | Class |
| Textbox | TextField |
| TextArea | TextArea |
| Push button | Button |
| Check box | CheckBox |
| Radio button | CheckboxGroup with CheckBox |
| Combo box | Choice |
| List box | List |
Next: The Button Class >>
More Java Articles
More By Gayathri Gokul