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 con
tainer 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 {@code 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 JDK1.0
|
Java Source File Name | Type | Comment |
ActiveEvent.java | Interface | An interface for events that know how to dispatch themselves.
By implementing this interface an event can be placed upon the event
queue and its dispatch() method will be called when the event
is dispatched, using the EventDispatchThread .
This is a very useful mechanism for avoiding deadlocks. |
Adjustable.java | Interface | The interface for objects which have an adjustable numeric value
contained within a bounded range of values. |
AlphaComposite.java | Class | The AlphaComposite class implements basic alpha
compositing rules for combining source and destination colors
to achieve blending and transparency effects with graphics and
images.
The specific rules implemented by this class are the basic set
of 12 rules described in
T. |
AttributeValue.java | Class | |
AWTError.java | Class | Thrown when a serious Abstract Window Toolkit error has occurred. |
AWTEvent.java | Class | The root event class for all AWT events.
This class and its subclasses supercede the original
java.awt.Event class.
Subclasses of this root AWTEvent class defined outside of the
java.awt.event package should define event ID values greater than
the value defined by RESERVED_ID_MAX.
The event masks defined in this class are needed by Component subclasses
which are using Component.enableEvents() to select for event types not
selected by registered listeners. |
AWTEventMulticaster.java | Class | AWTEventMulticaster implements efficient and thread-safe multi-cast
event dispatching for the AWT events defined in the
java.awt.event package.
The following example illustrates how to use this class:
public myComponent extends Component {
ActionListener actionListener = null;
public synchronized void addActionListener(ActionListener l) {
actionListener = AWTEventMulticaster.add(actionListener, l);
}
public synchronized void removeActionListener(ActionListener l) {
actionListener = AWTEventMulticaster.remove(actionListener, l);
}
public void processEvent(AWTEvent e) {
// when event occurs which causes "action" semantic
ActionListener listener = actionListener;
if (listener != null) {
listener.actionPerformed(new ActionEvent());
}
}
}
The important point to note is the first argument to the
add and
remove methods is the field maintaining the
listeners. |
AWTException.java | Class | Signals that an Absract Window Toolkit exception has occurred. |
AWTKeyStroke.java | Class | An AWTKeyStroke represents a key action on the
keyboard, or equivalent input device. |
AWTPermission.java | Class | This class is for AWT permissions.
An AWTPermission contains a target name but
no actions list; you either have the named permission
or you don't.
The target name is the name of the AWT permission (see below). |
BasicStroke.java | Class | 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 .
The rendering attributes defined by BasicStroke describe
the shape of the mark made by a pen drawn along the outline of a
Shape and the decorations applied at the ends and joins of
path segments of the Shape .
These rendering attributes include:
- width
- The pen width, measured perpendicularly to the pen trajectory.
- end caps
- The decoration applied to the ends of unclosed subpaths and
dash segments.
|
BorderLayout.java | Class | A border layout lays out a container, arranging and resizing
its components to fit in five regions:
north, south, east, west, and center.
Each region may contain no more than one component, and
is identified by a corresponding constant:
NORTH , SOUTH , EAST ,
WEST , and CENTER . |
BufferCapabilities.java | Class | Capabilities and properties of buffers. |
Button.java | Class | This class creates a labeled button. |
Canvas.java | Class | 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. |
CardLayout.java | Class | A CardLayout object is a layout manager for a
container. |
Checkbox.java | Class | A check box is a graphical component that can be in either an
"on" (true ) or "off" (false ) state.
Clicking on a check box changes its state from
"on" to "off," or from "off" to "on."
The following code example creates a set of check boxes in
a grid layout:
setLayout(new GridLayout(3, 1));
add(new Checkbox("one", null, true));
add(new Checkbox("two"));
add(new Checkbox("three"));
This image depicts the check boxes and grid layout
created by this code example:
The button labeled one is in the "on" state, and the
other two are in the "off" state. |
CheckboxGroup.java | Class | The CheckboxGroup class is used to group together
a set of Checkbox buttons. |
CheckboxMenuItem.java | Class | This class represents a check box that can be included in a menu.
Selecting the check box in the menu changes its state from
"on" to "off" or from "off" to "on."
The following picture depicts a menu which contains an instance
of CheckBoxMenuItem :
Choice.java | Class | The Choice class presents a pop-up menu of choices. |
Color.java | Class | The Color class is used to encapsulate colors in the default
sRGB color space or colors in arbitrary color spaces identified by a
ColorSpace . |
ColorPaintContext.java | Class | |
Component.java | Class | A component is an object having a graphical representation
that can be displayed on the screen and that can interact with the
user. |
ComponentOrientation.java | Class | The ComponentOrientation class encapsulates the language-sensitive
orientation that is to be used to order the elements of a component
or of text. |
Composite.java | Interface | The Composite interface, along with
CompositeContext , defines the methods to compose a draw
primitive with the underlying graphics area.
After the Composite is set in the
Graphics2D context, it combines a shape, text, or an image
being rendered with the colors that have already been rendered
according to pre-defined rules. |
CompositeContext.java | Interface | The CompositeContext interface defines the encapsulated
and optimized environment for a compositing operation.
CompositeContext objects maintain state for
compositing operations. |
Conditional.java | Interface | 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. |
Container.java | Class | A generic Abstract Window Toolkit(AWT) container object is a component
that can contain other AWT components.
Components added to a container are tracked in a list. |
ContainerOrderFocusTraversalPolicy.java | Class | A FocusTraversalPolicy that determines traversal order based on the order
of child Components in a Container. |
Cursor.java | Class | A class to encapsulate the bitmap representation of the mouse cursor. |
DefaultFocusTraversalPolicy.java | Class | A FocusTraversalPolicy that determines traversal order based on the order
of child Components in a Container. |
DefaultKeyboardFocusManager.java | Class | The default KeyboardFocusManager for AWT applications. |
Desktop.java | Class | The
Desktop class allows a Java application to launch
associated applications registered on the native desktop to handle
a
java.net.URI or a file.
Supported operations include:
- launching the user-default browser to show a specified
URI;
- launching the user-default mail client with an optional
mailto URI;
- launching a registered application to open, edit or print a
specified file.
This class provides methods corresponding to these
operations. |
Dialog.java | Class | 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.
The size of the dialog includes any area designated for the
border. |
Dimension.java | Class | The Dimension class encapsulates the width and
height of a component (in integer precision) in a single object. |
DisplayMode.java | Class | The DisplayMode class encapsulates the bit depth, height,
width, and refresh rate of a GraphicsDevice . |
Event.java | Class | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
EventDispatchThread.java | Class | EventDispatchThread is a package-private AWT class which takes
events off the EventQueue and dispatches them to the appropriate
AWT components.
The Thread starts a "permanent" event pump with a call to
pumpEvents(Conditional) in its run() method. |
EventFilter.java | Interface | |
EventQueue.java | Class | EventQueue is a platform-independent class
that queues events, both from the underlying peer classes
and from trusted application classes.
It encapsulates asynchronous event dispatch machinery which
extracts events from the queue and dispatches them by calling
EventQueue.dispatchEvent(AWTEvent) dispatchEvent(AWTEvent) method
on this EventQueue with the event to be dispatched
as an argument. |
FileDialog.java | Class | The FileDialog class displays a dialog window
from which the user can select a file. |
FlowLayout.java | Class | A flow layout arranges components in a directional flow, much
like lines of text in a paragraph. |
FocusTraversalPolicy.java | Class | A FocusTraversalPolicy defines the order in which Components with a
particular focus cycle root are traversed. |
Font.java | Class | The Font class represents fonts, which are used to
render text in a visible way.
A font provides the information needed to map sequences of
characters to sequences of glyphs
and to render sequences of glyphs on Graphics and
Component objects.
Characters and Glyphs
A character is a symbol that represents an item such as a letter,
a digit, or punctuation in an abstract way. |
FontFormatException.java | Class | Thrown by method createFont in the Font class to indicate
that the specified font is bad. |
FontMetrics.java | Class | The FontMetrics class defines a font metrics object, which
encapsulates information about the rendering of a particular font on a
particular screen. |
Frame.java | Class | A Frame is a top-level window with a title and a border.
The size of the frame includes any area designated for the
border. |
GradientPaint.java | Class | The GradientPaint class provides a way to fill
a
Shape with a linear color gradient pattern.
If
Point P1 with
Color C1 and Point P2 with
Color C2 are specified in user space, the
Color on the P1, P2 connecting line is proportionally
changed from C1 to C2. |
GradientPaintContext.java | Class | |
Graphics.java | Class | 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.
A Graphics object encapsulates state information needed
for the basic rendering operations that Java supports. |
Graphics2D.java | Class | This Graphics2D class extends the
Graphics class to provide more sophisticated
control over geometry, coordinate transformations, color management,
and text layout. |
GraphicsCallback.java | Class | |
GraphicsConfigTemplate.java | Class | The GraphicsConfigTemplate class is used to obtain a valid
GraphicsConfiguration . |
GraphicsConfiguration.java | Class | The GraphicsConfiguration class describes the
characteristics of a graphics destination such as a printer or monitor.
There can be many GraphicsConfiguration objects associated
with a single graphics device, representing different drawing modes or
capabilities. |
GraphicsDevice.java | Class | The GraphicsDevice class describes the graphics devices
that might be available in a particular graphics environment. |
GraphicsEnvironment.java | Class | The GraphicsEnvironment class describes the collection
of
GraphicsDevice objects and
java.awt.Font objects
available to a Java(tm) application on a particular platform.
The resources in this GraphicsEnvironment might be local
or on a remote machine. |
GridBagConstraints.java | Class | The GridBagConstraints class specifies constraints
for components that are laid out using the
GridBagLayout class. |
GridBagLayout.java | Class | 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.
Each GridBagLayout object maintains a dynamic,
rectangular grid of cells, with each component occupying
one or more cells, called its display area.
Each component managed by a GridBagLayout is associated with
an instance of
GridBagConstraints . |
GridBagLayoutInfo.java | Class | The
GridBagLayoutInfo is an utility class for
GridBagLayout layout manager. |
GridLayout.java | Class | The GridLayout class is a layout manager that
lays out a container's components in a rectangular grid. |
HeadlessException.java | Class | 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. |
IllegalComponentStateException.java | Class | Signals that an AWT component is not in an appropriate state for
the requested operation. |
Image.java | Class | The abstract class Image is the superclass of all
classes that represent graphical images. |
ImageCapabilities.java | Class | Capabilities and properties of images. |
Insets.java | Class | An Insets object is a representation of the borders
of a container. |
ItemSelectable.java | Interface | The interface for objects which contain a set of items for
which zero or more can be selected. |
JobAttributes.java | Class | A set of attributes which control a print job.
Instances of this class control the number of copies, default selection,
destination, print dialog, file and printer names, page ranges, multiple
document handling (including collation), and multi-page imposition (such
as duplex) of every print job which uses the instance. |
KeyboardFocusManager.java | Class | The KeyboardFocusManager is responsible for managing the active and focused
Windows, and the current focus owner. |
KeyEventDispatcher.java | Interface | A KeyEventDispatcher cooperates with the current KeyboardFocusManager in the
targeting and dispatching of all KeyEvents. |
KeyEventPostProcessor.java | Interface | A KeyEventPostProcessor cooperates with the current KeyboardFocusManager
in the final resolution of all unconsumed KeyEvents. |
Label.java | Class | A Label object is a component for placing text in a
container. |
LayoutManager.java | Interface | Defines the interface for classes that know how to lay out
Container s.
Swing's painting architecture assumes the children of a
JComponent do not overlap. |
LayoutManager2.java | Interface | Defines an interface for classes that know how to layout Containers
based on a layout constraints object. |
LinearGradientPaint.java | Class | The
LinearGradientPaint class provides a way to fill
a
java.awt.Shape with a linear color gradient pattern. |
LinearGradientPaintContext.java | Class | Provides the actual implementation for the LinearGradientPaint. |
List.java | Class | The List component presents the user with a
scrolling list of text items. |
MediaTracker.java | Class | The MediaTracker class is a utility class to track
the status of a number of media objects. |
Menu.java | Class | A Menu object is a pull-down menu component
that is deployed from a menu bar.
A menu can optionally be a tear-off menu. |
MenuBar.java | Class | The MenuBar class encapsulates the platform's
concept of a menu bar bound to a frame. |
MenuComponent.java | Class | The abstract class MenuComponent is the superclass
of all menu-related components. |
MenuContainer.java | Interface | The super class of all menu related containers. |
MenuItem.java | Class | All items in a menu must belong to the class
MenuItem , or one of its subclasses.
The default MenuItem object embodies
a simple labeled menu item.
This picture of a menu bar shows five menu items:
The first two items are simple menu items, labeled
"Basic" and "Simple" .
Following these two items is a separator, which is itself
a menu item, created with the label "-" .
Next is an instance of CheckboxMenuItem
labeled "Check" . |
MenuShortcut.java | Class | The MenuShortcut class represents a keyboard accelerator
for a MenuItem.
Menu shortcuts are created using virtual keycodes, not characters. |
ModalEventFilter.java | Class | |
MouseInfo.java | Class | MouseInfo provides methods for getting information about the mouse,
such as mouse pointer location and the number of mouse buttons. |
MultipleGradientPaint.java | Class | This is the superclass for Paints which use a multiple color
gradient to fill in their raster. |
MultipleGradientPaintContext.java | Class | This is the superclass for all PaintContexts which use a multiple color
gradient to fill in their raster. |
PageAttributes.java | Class | A set of attributes which control the output of a printed page.
Instances of this class control the color state, paper size (media type),
orientation, logical origin, print quality, and resolution of every
page which uses the instance. |
Paint.java | Interface | This Paint interface defines how color patterns
can be generated for
Graphics2D operations. |
PaintContext.java | Interface | The PaintContext interface defines the encapsulated
and optimized environment to generate color patterns in device
space for fill or stroke operations on a
Graphics2D . |
Panel.java | Class | Panel is the simplest container class. |
Point.java | Class | A point representing a location in
(x,y) coordinate space,
specified in integer precision. |
PointerInfo.java | Class | A class that describes the pointer position.
It provides the GraphicsDevice where the
pointer is and the Point that represents
the coordinates of the pointer.
Instances of this class should be obtained via
MouseInfo.getPointerInfo .
The PointerInfo instance is not updated dynamically
as the mouse moves. |
Polygon.java | Class | The Polygon class encapsulates a description of a
closed, two-dimensional region within a coordinate space. |
PopupMenu.java | Class | A class that implements a menu which can be dynamically popped up
at a specified position within a component. |
PrintGraphics.java | Interface | An abstract class which provides a print graphics context for a page. |
PrintJob.java | Class | An abstract class which initiates and executes a print job. |
RadialGradientPaint.java | Class | The
RadialGradientPaint class provides a way to fill a shape with
a circular radial color gradient pattern. |
RadialGradientPaintContext.java | Class | Provides the actual implementation for the RadialGradientPaint.
This is where the pixel processing is done. |
Rectangle.java | Class | 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. |
RenderingHints.java | Class | 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. |
Robot.java | Class | 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. |
Scrollbar.java | Class | The Scrollbar class embodies a scroll bar, a
familiar user-interface object. |
ScrollPane.java | Class | A container class which implements automatic horizontal and/or
vertical scrolling for a single child component. |
ScrollPaneAdjustable.java | Class | This class represents the state of a horizontal or vertical
scrollbar of a ScrollPane . |
SentEvent.java | Class | A wrapping tag for a nested AWTEvent which indicates that the event was
sent from another AppContext. |
SequencedEvent.java | Class | A mechanism for ensuring that a series of AWTEvents are executed in a
precise order, even across multiple AppContexts. |
Shape.java | Interface | The Shape interface provides definitions for objects
that represent some form of geometric shape. |
SplashScreen.java | Class | The splash screen can be created at application startup, before the
Java Virtual Machine (JVM) starts. |
Stroke.java | Interface | 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 . |
SystemColor.java | Class | A class to encapsulate symbolic colors representing the color of
native GUI objects on a system. |
SystemTray.java | Class | The SystemTray class represents the system tray for a
desktop. |
TextArea.java | Class | A TextArea object is a multi-line region
that displays text. |
TextComponent.java | Class | The TextComponent class is the superclass of
any component that allows the editing of some text. |
TextField.java | Class | A TextField object is a text component
that allows for the editing of a single line of text.
For example, the following image depicts a frame with four
text fields of varying widths. |
TexturePaint.java | Class | The TexturePaint class provides a way to fill a
Shape with a texture that is specified as
a
BufferedImage . |
TexturePaintContext.java | Class | |
Toolkit.java | Class | This class is the abstract superclass of all actual
implementations of the Abstract Window Toolkit. |
Transparency.java | Interface | The Transparency interface defines the common transparency
modes for implementing classes. |
TrayIcon.java | Class | A TrayIcon object represents a tray icon that can be
added to the
SystemTray system tray . |
Window.java | Class | A Window object is a top-level window with no borders and no
menubar. |