The Abstract Window Toolkit
The Java Development Kit contains a set of widget- and
utility classes for creating simple graphical user-interfaces:
the Abstract Window Toolkit or AWT.
Small applications with user-interfaces are often
called Applets.
Main features of the AWT are:
- It offers widgets and features that are available (and functionally
but not visually identical) on all computing platforms.
- It offers an event model
that is closely tied to the object-oriented
and layered model for user-interfaces.
- It offers classes for communicating with a Web-browser and with remote
machines over Internet, for loading and manipulating images, and for loading
and playing sound.
- It conforms to the JavaBeans
standard for reusable components.
Many classes in AWT define components that
represent some type of user-interface element.
Examples are:
- Canvas: a rectangular area onto which the application
can draw and which can generate events. (Must be extended to do something
useful.)
- Label: a rectangle for displaying a string.
- Button: like a label, but generates an event when
clicked on.
- Checkbox: a checkbox followed by a string.
Maintains a state (on or off).
- CheckboxGroup: a group of radio buttons, each followed
by a string.
- Choice: a popup-menu with a fixed location, that
always shows the last menu selection.
- PopupMenu.html: a popup-menu which can be displayed
at any location and is only visible when popped up.
- Dialog: a dialog box (which appears in a separate
top-level window), and of which the dialog blocks interaction with the
main window.
- List: a scrolling list of choices, of which more than
one can be selected.
- TextArea: a (scrolling) editable text area.
- TextField: a (scrolling) editable text field.
Some classes define containers: they
hold other graphical objects, possibly laid out by means of a
layout manager.
Containers are also components. A dialog box is an example of a container.