Core Java - [AWT Classes]

♠ Posted by Unknown in at 21:12

AWT (Abstract Window Toolkit) classes


The Design of the AWT is an excellent example of using classes, inheritances, and interfaces. The AWT contains the following essential classes. The class’s hierarchical relationship is shown below.

1.  Component: This is a super class of all AWT user interface classes.

2.  Container: This is used to group components. A container can be embedded in another container. A layout manager is used to position and place the components in the desired location and style in a container. Example of containers are frames and panels.

3.  Window: The window class can be sued to create a top-level windows, however, often Window’s subclasses-Frame and Dialog-are used instead.

4.  Frame: This is a window that is not contained inside another window. Frame is the basis to contain other user interface components in Java Graphical Applications.

5.  Dialog: This is a pop-up window that is usually used as a temporary window to receive additional information from the user or to provide notification that an event has occurred.

6.  Panel: This is an invisible container that holds user interface components. You can place panels in a frame in Java applications or in an applet in Java applets.

7.  Applet: This is a subclass of Panel. Anything you place in a panel can also be placed in an applet. You use Frame when writing applications and Applet when writing applets.

8.  Graphics: This is an abstract class that provides a graphical context for drawing strings, lines and shapes.

9.  Color: This deals with colors of graphics components. For example, you can specify background or foreground colors in a component, such as Frame and Panel, or you can specify colors of lines, shapes and strings in drawing.

10.Font: This is used to draw strings in Graphics. For example, you can specify the font type (Times New Roman), style (Bold), and size (24 points) for string.

11.FontMetrics: This is an abstract class that is used to get properties of the fonts used in drawings.

And the classes Button, Canvas, Checkbox, Menu, Choice, Label, List, Scrollbar, TextField, and TextArea are for constructing the GUI.

1 comments:

Nicely work!! Explanatory blog post.

Post a Comment