AWT - SPLessons

AWT Controls

Chapter 6

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

AWT Controls

AWT Controls

shape Description

AWT Controls are nothing but AWT Components that allows the user to communicate with the user in different ways.

Normally, positioning of LayoutManager inside a container will be done automatically.With this example, it can be concluded that window visual nature depends on the LayoutManagers and Controls.

It can also be said that interaction with the user will be done based on following three concepts:

UI elements

shape Description

The UI elements are the one which user directly looks and interacts with. AWT has wide variety of common elements from basic to complex.

  1. Label
  2. Button
  3. Choice
  4. Checkbox
  5. List
  6. Canvas
  7. ScrollBar

The detailed description of above components will be discussed in detail in the chapter “AWT Components”

Layouts

shape Description

Layout is defined as the order of placement of the components in a container. This arrangement can be done by LayoutManager. The detailed description about Layouts is given in AWT Layout chapter.

Behavior

shape Description

These events figure out the behavior of UI elements when the user communicates with the elements. The detailed description about Layouts is given in AWT Layout chapter.

Add/Remove controls

shape Description

Initially an instance of required control has to be created and in the next step instance should be added to the window by calling add() method.

Syntax

Component add(Component obj)

=> The control can be removed from window by calling the method remove().

Syntax

Void remove(Component obj)

=> All the controls can be removed at a time by calling the method removeAll().

Summary

shape Key Points

  • Controls are components that communicate with the users.
  • UI Elements, Layouts and Behavior of elements are the main requirements in AWT Controls.