Skip to Main Content
Java Swing, 2nd Edition
book

Java Swing, 2nd Edition

by Dave Wood, Robert Eckstein, Marc Loy, James Elliott, Brian Cole
November 2002
Intermediate to advanced content levelIntermediate to advanced
1278 pages
38h 26m
English
O'Reilly Media, Inc.
Content preview from Java Swing, 2nd Edition

The Accessibility Package

Now let’s discuss the issues an assistive technology encounters when hooking into an accessibility-friendly application.

The Path to Determining Accessibility

Almost all Swing objects support one or more forms of accessibility, which means that they implement the Accessible interface. However, for an assistive technology to find out which types of accessibility an application supports, the technology needs to do some investigating. The typical course of action runs like this:

  1. The assistive technology locates a desired component in the target application with the help of the Accessibility Utility APIs. Once found, it invokes the getAccessibleContext( ) method of the component object, which is the sole method of the Accessible interface. This method returns a customized AccessibleContext object, often an inner class of the component.

  2. The assistive technology can then use the AccessibleContext object to retrieve the name, description, role, state, parent, and children components of the accessible component in question.

  3. The assistive technology can register for any property change events in the component it’s interested in.

  4. The assistive technology can call upon several standardized methods to determine whether those types of accessibility are supported. All AccessibleContext objects have these interface methods. If any of these methods return null, then the component does not support the specific accessibility type.

  5. If they are not null, the objects returned by each ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Threads, 3rd Edition

Java Threads, 3rd Edition

Scott Oaks, Henry Wong

Publisher Resources

ISBN: 0596004087Errata PageSupplemental Content