APIdia Launch Partner
Top Description Interfaces Classes
module java.desktop

Package java.awt


Contains all of the classes for creating user interfaces and for painting graphics and images. A user interface object such as a button or a scrollbar is called, in AWT terminology, a component. The Component class is the root of all AWT components. See Component for a detailed description of properties that all AWT components share.

Some components fire events when a user interacts with the components. The AWTEvent class and its subclasses are used to represent the events that AWT components can fire. See AWTEvent for a description of the AWT event model.

A container is a component that can contain components and other containers. A container can also have a layout manager that controls the visual placement of components in the container. The AWT package contains several layout manager classes and an interface for building your own layout manager. See Container and LayoutManager for more information.

Each Component object is limited in its maximum size and its location because the values are stored as an integer. Also, a platform may further restrict maximum size and location coordinates. The exact maximum values are dependent on the platform. There is no way to change these maximum values, either in Java code or in native code. These limitations also impose restrictions on component layout. If the bounds of a Component object exceed a platform limit, there is no way to properly arrange them within a Container object. The object's bounds are defined by any object's coordinate in combination with its size on a respective axis.

Additional Specification

Since
1.0
External Specification
The Java AWT Native Interface Specification and Guide

Interface Summary

Modifier and TypeInterface and Description
public interface
ActiveEvent

An interface for events that know how to dispatch themselves.

public interface
Adjustable

The interface for objects which have an adjustable numeric value contained within a bounded range of values.

public interface
Composite

The Composite interface, along with CompositeContext, defines the methods to compose a draw primitive with the underlying graphics area.

public interface
CompositeContext

The CompositeContext interface defines the encapsulated and optimized environment for a compositing operation.

pack-priv interface
Conditional

Conditional is used by the EventDispatchThread's message pumps to determine if a given pump should continue to run, or should instead exit and yield control to the parent pump.

pack-priv interface
public interface
ItemSelectable

The interface for objects which contain a set of items for which zero or more can be selected.

public interface
KeyEventDispatcher

A KeyEventDispatcher cooperates with the current KeyboardFocusManager in the targeting and dispatching of all KeyEvents.

public interface
KeyEventPostProcessor

A KeyEventPostProcessor cooperates with the current KeyboardFocusManager in the final resolution of all unconsumed KeyEvents.

public interface
LayoutManager

Defines the interface for classes that know how to lay out Containers.

public interface
LayoutManager2

Defines an interface for classes that know how to layout Containers based on a layout constraints object.

public interface
MenuContainer

The super class of all menu related containers.

public interface
Paint

This Paint interface defines how color patterns can be generated for Graphics2D operations.

public interface
PaintContext

The PaintContext interface defines the encapsulated and optimized environment to generate color patterns in device space for fill or stroke operations on a Graphics2D.

public interface
PrintGraphics

An abstract class which provides a print graphics context for a page.

public interface
SecondaryLoop

A helper interface to run the nested event loop.

public interface
Shape

The Shape interface provides definitions for objects that represent some form of geometric shape.

public interface
Stroke

The Stroke interface allows a Graphics2D object to obtain a Shape that is the decorated outline, or stylistic representation of the outline, of the specified Shape.

public interface
Transparency

The Transparency interface defines the common transparency modes for implementing classes.

Class Summary

Modifier and TypeClass and Description
public class
AlphaComposite

The AlphaComposite class implements basic alpha compositing rules for combining source and destination colors to achieve blending and transparency effects with graphics and images.

pack-priv abstract class
public class
AWTError

Thrown when a serious Abstract Window Toolkit error has occurred.

public abstract class
AWTEvent

The root event class for all AWT events.

public class
AWTEventMulticaster

AWTEventMulticaster implements efficient and thread-safe multi-cast event dispatching for the AWT events defined in the java.awt.event package.

public class
AWTException

Signals that an Abstract Window Toolkit exception has occurred.

public class
AWTKeyStroke

An AWTKeyStroke represents a key action on the keyboard, or equivalent input device.

public class
AWTPermission

Deprecated for removal since 24. There is no replacement for this class.
This class is for AWT permissions.
public class
BasicStroke

The BasicStroke class defines a basic set of rendering attributes for the outlines of graphics primitives, which are rendered with a Graphics2D object that has its Stroke attribute set to this BasicStroke.

public class
BorderLayout

A border layout lays out a container, arranging and resizing its components to fit in five regions: north, south, east, west, and center.

public class
BufferCapabilities

Capabilities and properties of buffers.

public class
Button

This class creates a labeled button.

public class
Canvas

A Canvas component represents a blank rectangular area of the screen onto which the application can draw or from which the application can trap input events from the user.

public class
CardLayout

A CardLayout object is a layout manager for a container.

public class
Checkbox

A check box is a graphical component that can be in either an "on" (true) or "off" (false) state.

public class
CheckboxGroup

The CheckboxGroup class is used to group together a set of Checkbox buttons.

public class
CheckboxMenuItem

This class represents a check box that can be included in a menu.

public class
Choice

The Choice class presents a pop-up menu of choices.

public class
Color

The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary color spaces identified by a ColorSpace.

pack-priv class
public abstract class
Component

A component is an object having a graphical representation that can be displayed on the screen and that can interact with the user.

public class
ComponentOrientation

The ComponentOrientation class encapsulates the language-sensitive orientation that is to be used to order the elements of a component or of text.

public class
Container

A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT components.

public class
ContainerOrderFocusTraversalPolicy

A FocusTraversalPolicy that determines traversal order based on the order of child Components in a Container.

public class
Cursor

A class to encapsulate the bitmap representation of the mouse cursor.

public class
DefaultFocusTraversalPolicy

A FocusTraversalPolicy that determines traversal order based on the order of child Components in a Container.

public class
DefaultKeyboardFocusManager

The default KeyboardFocusManager for AWT applications.

public class
Desktop

The Desktop class allows interact with various desktop capabilities.

public class
Dialog

A Dialog is a top-level window with a title and a border that is typically used to take some form of input from the user.

public class
Dimension

The Dimension class encapsulates the width and height of a component (in integer precision) in a single object.

public class
DisplayMode

The DisplayMode class encapsulates the bit depth, height, width, and refresh rate of a GraphicsDevice.

public class
Event

Deprecated since 9. It is recommended that AWTEvent and its subclasses be used instead

Event is a platform-independent class that encapsulates events from the platform's Graphical User Interface in the Java 1.0 event model.

pack-priv class
EventDispatchThread

EventDispatchThread is a package-private AWT class which takes events off the EventQueue and dispatches them to the appropriate AWT components.

public class
EventQueue

EventQueue is a platform-independent class that queues events, both from the underlying peer classes and from trusted application classes.

public class
FileDialog

The FileDialog class displays a dialog window from which the user can select a file.

public class
FlowLayout

A flow layout arranges components in a directional flow, much like lines of text in a paragraph.

pack-priv class
FocusManager

This class is no longer used, but is maintained for Serialization backward-compatibility.

public abstract class
FocusTraversalPolicy

A FocusTraversalPolicy defines the order in which Components with a particular focus cycle root are traversed.

public class
Font

The Font class represents fonts, which are used to render text in a visible way.

public class
FontFormatException

Thrown by method createFont in the Font class to indicate that the specified font is bad.

public abstract class
FontMetrics

The FontMetrics class defines a font metrics object, which encapsulates information about the rendering of a particular font on a particular screen.

public class
Frame

A Frame is a top-level window with a title and a border.

public class
GradientPaint

The GradientPaint class provides a way to fill a Shape with a linear color gradient pattern.

pack-priv class
public abstract class
Graphics

The Graphics class is the abstract base class for all graphics contexts that allow an application to draw onto components that are realized on various devices, as well as onto off-screen images.

public abstract class
Graphics2D

This Graphics2D class extends the Graphics class to provide more sophisticated control over geometry, coordinate transformations, color management, and text layout.

pack-priv abstract class
public abstract class
GraphicsConfigTemplate

The GraphicsConfigTemplate class is used to obtain a valid GraphicsConfiguration.

public abstract class
GraphicsConfiguration

The GraphicsConfiguration class describes the characteristics of a graphics destination such as a printer or monitor.

public abstract class
GraphicsDevice

The GraphicsDevice class describes the graphics devices that might be available in a particular graphics environment.

public abstract class
GraphicsEnvironment

The GraphicsEnvironment class describes the collection of GraphicsDevice objects and java.awt.Font objects available to a Java(tm) application on a particular platform.

public class
GridBagConstraints

The GridBagConstraints class specifies constraints for components that are laid out using the GridBagLayout class.

public class
GridBagLayout

The GridBagLayout class is a flexible layout manager that aligns components vertically, horizontally or along their baseline without requiring that the components be of the same size.

public class
GridBagLayoutInfo

The GridBagLayoutInfo is an utility class for GridBagLayout layout manager.

public class
GridLayout

The GridLayout class is a layout manager that lays out a container's components in a rectangular grid.

public class
HeadlessException

Thrown when code that is dependent on a keyboard, display, or mouse is called in an environment that does not support a keyboard, display, or mouse.

public class
IllegalComponentStateException

Signals that an AWT component is not in an appropriate state for the requested operation.

public abstract class
Image

The abstract class Image is the superclass of all classes that represent graphical images.

public class
ImageCapabilities

Capabilities and properties of images.

pack-priv class
ImageMediaEntry

The entry of the list of Images that is being tracked by the MediaTracker.

public class
Insets

An Insets object is a representation of the borders of a container.

public class
JobAttributes

A set of attributes which control a print job.

public abstract class
KeyboardFocusManager

The KeyboardFocusManager is responsible for managing the active and focused Windows, and the current focus owner.

public class
Label

A Label object is a component for placing text in a container.

pack-priv class
LightweightDispatcher

Class to manage the dispatching of MouseEvents to the lightweight descendants and SunDropTargetEvents to both lightweight and heavyweight descendants contained by a native container.

public class
LinearGradientPaint

The LinearGradientPaint class provides a way to fill a java.awt.Shape with a linear color gradient pattern.

pack-priv class
LinearGradientPaintContext

Provides the actual implementation for the LinearGradientPaint.

public class
List

The List component presents the user with a scrolling list of text items.

pack-priv abstract class
public class
MediaTracker

The MediaTracker class is a utility class to track the status of a number of media objects.

public class
Menu

A Menu object is a pull-down menu component that is deployed from a menu bar.

public class
MenuBar

The MenuBar class encapsulates the platform's concept of a menu bar bound to a frame.

public abstract class
MenuComponent

The abstract class MenuComponent is the superclass of all menu-related components.

public class
MenuItem

All items in a menu must belong to the class MenuItem, or one of its subclasses.

public class
MenuShortcut

The MenuShortcut class represents a keyboard accelerator for a MenuItem.

pack-priv abstract class
public class
MouseInfo

MouseInfo provides methods for getting information about the mouse, such as mouse pointer location and the number of mouse buttons.

public abstract class
MultipleGradientPaint

This is the superclass for Paints which use a multiple color gradient to fill in their raster.

pack-priv abstract class
MultipleGradientPaintContext

This is the superclass for all PaintContexts which use a multiple color gradient to fill in their raster.

public class
PageAttributes

A set of attributes which control the output of a printed page.

public class
Panel

Panel is the simplest container class.

public class
Point

A point representing a location in (x,y) coordinate space, specified in integer precision.

public class
PointerInfo

A class that describes the pointer position.

public class
Polygon

The Polygon class encapsulates a description of a closed, two-dimensional region within a coordinate space.

public class
PopupMenu

A class that implements a menu which can be dynamically popped up at a specified position within a component.

public abstract class
PrintJob

An abstract class which initiates and executes a print job.

pack-priv class
Queue

The Queue object holds pointers to the beginning and end of one internal queue.

public class
RadialGradientPaint

The RadialGradientPaint class provides a way to fill a shape with a circular radial color gradient pattern.

pack-priv class
RadialGradientPaintContext

Provides the actual implementation for the RadialGradientPaint.

public class
Rectangle

A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's upper-left point (x,y) in the coordinate space, its width, and its height.

public class
RenderingHints

The RenderingHints class defines and manages collections of keys and associated values which allow an application to provide input into the choice of algorithms used by other classes which perform rendering and image manipulation services.

public class
Robot

This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed.

public class
Scrollbar

The Scrollbar class embodies a scroll bar, a familiar user-interface object.

public class
ScrollPane

A container class which implements automatic horizontal and/or vertical scrolling for a single child component.

public class
ScrollPaneAdjustable

This class represents the state of a horizontal or vertical scrollbar of a ScrollPane.

pack-priv class
SentEvent

A wrapping tag for a nested AWTEvent.

pack-priv class
SequencedEvent

A mechanism for ensuring that a series of AWTEvents are executed in a precise order.

public class
SplashScreen

The splash screen can be displayed at application startup, before the Java Virtual Machine (JVM) starts.

public class
SystemColor

A class to encapsulate symbolic colors representing the color of native GUI objects on a system.

public class
SystemTray

The SystemTray class represents the system tray for a desktop.

public class
Taskbar

The Taskbar class allows a Java application to interact with the system task area (taskbar, Dock, etc.).

public class
TextArea

A TextArea object is a multi-line region that displays text.

public class
TextComponent

The TextComponent class is the superclass of any component that allows the editing of some text.

public class
TextField

A TextField object is a text component that allows for the editing of a single line of text.

public class
TexturePaint

The TexturePaint class provides a way to fill a Shape with a texture that is specified as a BufferedImage.

pack-priv abstract class
public abstract class
Toolkit

This class is the abstract superclass of all actual implementations of the Abstract Window Toolkit.

public class
TrayIcon

A TrayIcon object represents a tray icon that can be added to the system tray.

pack-priv class
pack-priv class
WaitDispatchSupport

This utility class is used to suspend execution on a thread while still allowing EventDispatchThread to dispatch events.

public class
Window

A Window object is a top-level window with no borders and no menubar.