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 ...

Get Java Swing, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.