The Abstract Windowing Toolkit Group
This Group was dissolved and consolidated into the Client Libraries Group.
This group is chartered with maintaining and enhancing the AWT.
Introduction
The AWT (Abstract Window Toolkit) provides an interface between a Java application and a native windowing system. AWT comprises the event handling system as well as a set of so-called heavyweight GUI components, including the top-level components such as frames and dialogs. It also has a simple set of widgets for use in situations where next level of more sophisticated GUI tools is not available.
Sources
AWT has a very old code base, and has a complicated structure. Parts of the code are intermingled with other low-level parts of JDK such as 2D, i18n, and Input Methods. The majority of the AWT code consists of the directories shown below.
-
src/share/classes/java/awt
:
Contains public API thoroughly specified in java.sun.com/javase/6/docs/technotes/guides/awt/index.html. To rebuild after a small change, go tomake/java/awt
. The result is a set of classes regularly packed inrt.jar
. -
src/share/classes/sun/awt
:
Contains API that is more volatile and not well documented. This has traditionally not been considered public API. Generally, an application developer should not use it.To rebuild after a small change, go tomake/sun/awt
. Changes here may require rebuilding of classes and certain libraries, for example splashscreen andawt.dll
. -
src/solaris/classes/sun/awt
andsrc/windows/classes/sun/awt
:
Contains low-level implementation of the AWT Toolkits: XToolkit for X Window-based systems, and WToolkit for MS Windows, and also the headless toolkit. Here you will also find code for MToolkit, requiring a proprietary Motif library. However, this is considered obsolete and isn't built as part of OpenJDK. For partial rebuilding you should start frommake/sun/awt
and/ormake/sun/xawt
. Classes,awt.dll
, andmawt.so
will be rebuilt in case of changes.
The native parts of the code base are written in C and C++. Most
of the code is platform-specific and resides in the corresponding
directories: src/solaris/
or
src/windows/
-
src/share/native/sun/awt
:
Currently only the splashscreen subdirectory is a part of AWT proper.
For small changes made here, you can rebuild frommake/sun/awt
ormake/sun/xawt,
depending on the platform. -
src/solaris/native/sun/awt
:
A significant part of this code was used to build MToolkit. Certain parts of it are still in use, however. To rebuild go tomake/sun/awt or make/sun/xawt
. Note that some of the code here leads to dead ends! -
src/solaris/native/sun/xawt
Contains a native part of XToolkit, AWT Toolkit for X Windows. It's not a large subsection, since most of XToolkit is written in Java. To rebuild go tomake/sun/xawt
. -
src/windows/native/sun/windows
,src/windows/native/sun/awt_common
andsrc/windows/native/sun/awt
A part of the code for MS Windows
Building and Rebuilding
The main result of the AWT building is a version of
mawt.so
library in Linux or Solaris, or
awt.dll
in MS Windows, and a set of classes.
Additionally, AWT builds the splashscreen library. After you have
completely built OpenJDK, you may modify and recompile parts by
starting from the root of the make
tree. However,
local changes in the AWT code may be recompiled faster from the
following directories depending on your platform:
make/java/awt
make/sun/awt
make/sun/xawt
Testing
All fixes must be tested, even seemingly trivial ones. Normally,
one should run all existing related regression tests, and alsso a
dedicated test written particularly for the modified code.
Sometimes an appropriate test may be found in the existing pool of
regression tests in the test/java/awt
subtree. If one
doesn't exist, it's often best to write a new test using a
template, then run it with the jtreg
script. In
general it's better to have an automated test as opposed to on that
needs to be run manually.
Note that in OpenJDK as it is first released, one will not find
many tests in the test/java/awt
area. We are working
on this, however, and eventually we will move most of them from our
work out into the open.
And the final note: remember that AWT should work on as many
platforms as possible. Try not to break linux x86_64 fixing for
solaris sparc:-)
Documentation
Community
- Mailing Lists
- AWT Bloggers