O'Reilly logo

Java Swing, 2nd Edition by Brian Cole, James Elliott, Marc Loy, Robert Eckstein, Dave Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other Accessible Objects

Before going further, there are several simple objects in the accessibility package used by AccessibleContext that we should discuss in more detail.

The AccessibleState Class

Each accessible component can have one or more states associated with it. An assistive technology can query these states at any time to determine how best to deal with the component. The accessible states can only be retrieved, however, and not set. There are two classes that the Accessible package uses to handle states: AccessibleState and AccessibleStateSet.

The AccessibleState class contains an enumeration of static objects that define states that any accessible component can have. Note that a component can be in more than one state at any time. A list of the possible states that an accessible object can be in, along with a brief description of each, is shown in Table 25-3.

Table 25-3. AccessibleState constants

State

Meaning

ACTIVE

The window, dialog, or frame is the active one.

ARMED

The object, such as a button, has been pressed but not released, and the mouse cursor is still over the button.

BUSY

The object is busy processing and should not be interrupted.

CHECKED

The object is checked.

COLLAPSED

The object, such as a node in a tree, is collapsed.

EDITABLE

The object supports any form of editing.

ENABLED

The object is enabled.

EXPANDABLE

The object, such as a node in a tree, can report its children.

EXPANDED

The object, such as a node in a tree, is expanded.

FOCUSABLE

The object can accept the focus. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required