Abstract Window Toolkit

Abstract Window Toolkit

The Abstract Window Toolkit (AWT) is Java's original platform-independent windowing, graphics, and user-interface widget toolkit. The AWT is now part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program.

AWT is also the GUI toolkit for a number of Mobile Java profiles. For example, Connected Device Configuration profiles require Java runtimes on mobile telephones to support AWT.

History

When Sun Microsystems first released Java in 1995, AWT widgets provided a thin level of abstraction over the underlying native user interface. For example, creating an AWT check box would cause AWT directly to call the underlying native subroutine that created a check box. However, a check box on Microsoft Windows is not exactly the same as a check box on Mac OS or on the various types of UNIX. Some application developers prefer this model because it provides a high degree of fidelity to the underlying native windowing toolkit and seamless integration with native applications. In other words, a GUI program written using AWT looks like a native Microsoft Windows application when run on Windows, but the same program looks like a native Apple Macintosh application when run on a Mac, etc. However, some application developers dislike this model because they prefer their applications to look exactly the same on every platform.

In J2SE 1.2, the AWT's widgets were largely superseded by those of the Swing toolkit. In addition to providing a richer set of UI widgets, Swing draws its own widgets (by using Java 2D to call into low-level subroutines in the local graphics subsystem) instead of relying on the operating system's high-level user interface module. Swing provides the option of using either a System "look and feel" which uses the native platform's look and feel, or a cross-platform look and feel (the "Java Look and Feel") that looks the same on all platforms. However, Swing relies on AWT for its interface to the native windowing system.

Architecture

The AWT provides two levels of APIs:

* A general interface between Java and the native system, used for windowing, events, layout managers. This API is at the core of Java GUI programming and is also used by Swing and Java 2D. It contains:
** The interface between the native windowing system and the Java application
** The core of the GUI event subsystem,
** Several layout managers,
** The interface to input devices such as mouse and keyboard,
** A Javadoc:SE|package=java.awt.datatransfer|java/awt/datatransfer package for use with the Clipboard and Drag and Drop,
* A basic set of GUI widgets such as buttons, text boxes, and menus. it also provide the AWT Native Interface, which enables rendering libraries compiled to native code to draw directly to an AWT Javadoc:SE|java/awt|Canvas object drawing surface.

AWT also provide some miscellaneous useful utilities, that can also be used by Swing, such as:
* Access to the system tray on supporting systems,
* The ability to launch some desktop applications such as web browsers and email clients from a Java application.

Neither AWT nor Swing are inherently thread safe. Therefore, code that updates the GUI or processes events should execute on the Event dispatching thread. Failure to do so may result in a deadlock or race condition. To address this problem, a utility class called SwingWorker allows applications to perform time-consuming tasks following user-interaction events in the event dispatching thread.

Implementation

As AWT bridge to the underlying native user interface, its implementation on a new operating system may involve a lot of work, especially for the set of AWT GUI widgets, which require to develop "ab initio" a native peer for each of AWT widgets.

Since the opening of Java, a project called [http://hg.openjdk.java.net/caciocavallo/caciocavallo/raw-file/tip/cacio-docs/index.html Caciocavallo] has been created. It aims to provide a Java API based on OpenJDK to ease AWT implementation on a new system [cite web
url=http://mail.openjdk.java.net/pipermail/challenge-discuss/2008-March/000082.html
title = FINAL PROPOSAL: Portable GUI backends
date = 2008-03-02
last=Torre|first=Mario
accessdate=2008-09-07
] . The project has successfully experimented the implementation of AWT widgets using Java2D [cite web
url=http://kennke.org/blog/2008/09/03/cacio-swing-awt-peers/
title = Cacio Swing AWT peers
date = 2008-09-03
last=Kennke|first=Roman
accessdate=2008-09-07
] .

See also

* Event dispatching thread
* AWT Native Interface (JAWT)
* Swing
* Standard Widget Toolkit
* SwingWorker

References

External links

* [http://java.sun.com/products/jdk/awt/ AWT homepage]
* (AWT Javadoc API documentation)
*
*


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Abstract Window Toolkit — (AWT) est une bibliothèque graphique pour Java, faisant partie de JFC (Java Foundation Classes). Cette bibliothèque a été introduite dès les premières versions de Java mais depuis Java 2, la bibliothèque de gestion de fenêtre officielle est Swing …   Wikipédia en Français

  • Abstract Window Toolkit — Для улучшения этой статьи желательно?: Исправить статью согласно стилистическим правилам Википедии …   Википедия

  • Abstract Window Toolkit — Windows form with some AWT examples. La Abstract Window Toolkit (AWT, en español Kit de Herramientas de Ventana Abstracta) es un kit de herramientas de gráficos, interfaz de usuario, y sistema de ventanas independiente de la plataforma original… …   Wikipedia Español

  • Abstract Window Toolkit — AWT Elemente auf GNU/Linux, das Athena Widget set benutzend Das Abstract Window Toolkit (AWT) ist Bestandteil der Java Foundation Classes (JFC) und stellt eine Standard API zur Erzeugung und Darstellung einer plattformunabhängigen grafischen… …   Deutsch Wikipedia

  • Toolkit — may refer to an assembly of tools.It may also refer to:* Widget toolkit * Toolkits for User InnovationSpecific toolkits include:* Abstract Window Toolkit * Accessibility Toolkit * Adventure Game Toolkit * B Toolkit * Battlefield Mod Development… …   Wikipedia

  • Toolkit — Sur les autres projets Wikimedia : « Toolkit », sur le Wiktionnaire (dictionnaire universel) Toolkit est un mot anglais qui est utilisé en informatique et le plus souvent dans le contexte des interfaces graphiques. Ce mot, qui… …   Wikipédia en Français

  • Standard Widget Toolkit — Infobox Software name = Standard Widget Toolkit caption = The Eclipse IDE, an SWT based application developer = Free software community latest release version = 3.4 latest release date = release date|2008|06|17 latest preview version = 3.5 M1… …   Wikipedia

  • Motif (widget toolkit) — Motif Stable release 2.3.3 / March 19, 2010; 19 months ago (2010 03 19) Type Widget toolkit Website www.openmotif.org …   Wikipedia

  • Dojo Toolkit — Developer(s) Dojo Foundation Stable release 1.6.1 / May 20, 2011; 5 months ago ( …   Wikipedia

  • Google Web Toolkit — Тип Ajax framework Разработчик Google Написана на Java Операционная система Windows NT, Mac OS X …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”