How Does Accessibility Work?

An assistive technology needs an entry point into a GUI before it can examine the state of each component. Java's accessibility framework specifies this entry point by enforcing the rule that each component's class implement the Accessible interface. For example, the JButton class implements Accessible.

The Accessible interface presents a getAccessibleContext method. When called, this method returns an object whose class implements the AccessibleContext interface. (Each component class contains an inner class that implements AccessibleContext.) After an assistive technology has this object, it can call various methods to learn more about the component. For example, after a JButton object has been created, an assistive ...

Get Special Edition Using Java 2 Standard 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.