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

The Accessibility Utility Classes

So far, we’ve seen how the Accessibility APIs help make Swing and AWT components easier to interface with assistive technologies. However, we haven’t seen what’s available on the other side of the contract. In reality, there are several classes that help assistive technologies interface with the JVM on startup, communicate with accessibility-friendly components, and capture and interpret various system events. These classes are called the accessibility utility classes. They are not part of Swing; instead, they exist as a separate package, com.sun.java.accessibility.util, which is distributed by Sun. (You can download this package from http://java.sun.com/products/jfc/.) The utility classes are crucial to assistive technology developers who wish to create specialized solutions that can communicate with any accessibility-friendly application.

Specifically, the accessibility utility classes can provide assistive technologies with:

  • A list of the top-level windows of all Java applications currently executing under that virtual machine

  • Support for locating the window that has input focus

  • Support for locating the current mouse position

  • Registration for listening for when top-level windows appear and disappear

  • The ability to register listeners for and insert events into the windowing event queue

For the purposes of this chapter, we will discuss only the central classes in the Accessibility Utilities API. We begin with the class that allows assistive technologies ...

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