What Is the AWT?

   

The AWT is a windowing framework that abstracts commonality from diverse platform-specific windowing systems (such as Windows GDI and UNIX Motif). Developers target the AWT and let each platform's Java runtime software handle the details of connecting the AWT to the platform's windowing system. This is in keeping with Java's portability mantra: "Write Once, Run Anywhere." (In other words, you should need to write your AWT code only once and have it run under the windowing system of any platform that supports Java.)

Perhaps the best way to start learning the AWT is to take a brief look at those Java packages that comprise this framework. Table 13.1 presents the names and contents of these packages.

Table 13.1. Java's AWT Packages
Package Contents
java.applet Interfaces and a class for constructing AWT applets. This functionality is also available to Swing applets.
java.awt Classes and interfaces for constructing user interfaces, graphics contexts, and images, and obtaining information about the graphics environment.
java.awt. color Classes for working with sophisticated color spaces.
java.awt.datatransfer Classes and interfaces for transferring data between and within applications.
java.awt.dnd Classes and interfaces for implementing drag and drop.
java.awt.event Classes and interfaces for working with different kinds of events.
java.awt.font Classes and interfaces for advanced font manipulation. (Used in the construction of portable software from an international perspective.)
java.awt.geom Classes and an interface for working with Java 2D shapes .
java.awt.im Classes and interfaces for working with the input method framework. (Used in the construction of portable software from an international perspective.)
java.awt.im.spi Interfaces that enable the development of input methods for use in any Java environment. (Used in the construction of portable software from an international perspective.)
java.awt.image Classes and interfaces for creating images, filtering images, and working with color models.
java.awt.image.renderable Classes and interfaces for creating rendering-independent images.
java.awt.print Classes and interfaces for printing.

The AWT packages contain nearly 300 classes and interfaces, which is a solid foundation on which to build. In fact, other JFC APIs ”Swing, Accessibility, Java 2D, and Drag and Drop ”are built on the AWT.

Because Java 2D and Drag and Drop are closely related to the AWT (from an architectural perspective), their classes and interfaces are stored in packages under the java.awt umbrella. A portion of Java 2D is stored in java.awt.geom, whereas the rest of this API is stored in other packages under java.awt. Furthermore, although most of Drag and Drop is stored in java.awt.dnd, some of this API is stored in java.awt.datatransfer.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net