Java Accessibility Utilities
Java Accessibility Utilities consist of a set of interfaces and classes. EventQueueMonitor provides core functions needed by assistive technologies.
The AccessibleIcon interface, for example, extends accessibility to icons. In particular, it gives you a way to specify an accessible description for an icon. It also allows you to retrieve the description and information about the icon's height and width. The code below shows how to turn an ordinary icon into accessible one.
import javax.accessibility.*;
...
AccessibleContext ac =
iButton.getAccessibleContext();
AccessibleIconai[] =
ac.getAccessibleIcon();
// Specify an accessible description
// for the icon
ai[0].setAccessibleIconDescription(
"An image of a house");
// Retrieve the accessible icon
// description
ai[0].getAccessibleIconDescription();
// Retrieve the accessible icon width
ai[0].getAccessibleIconWidth();
// retrieve the accessible icon
// height
ai[0].getAccessibleIconHeight();
A new method in getAcessibleContext, called getAccessibleIcon, returns an array of type AccessibleIcon. Each element of the array represents an accessible icon that is associated with the object of interest. In this case, the button has one accessible icon, the house icon.
The AccessibleTable interface extends accessibility information to tables. For example, it provides methods for setting and retrieving an accessible caption for a table, and for getting the number of rows and columns in a table. The Swing class JTable.AccessibleJTable implements the AccessibleTable interface. The getAccessibleTable method in the AccessibleContext returns an object of type AccessibleTable. This object contains a variety of methods for setting and retrieving accessible information about the table. For example, this includes the getAccessibleColumnCount and getAccessibleRowCount methods.
Make JAB interact with Windows, UNIX, and Linux
There are initiatives for JAAPI interaction at the native level for Windows and for GNOME desktop on UNIX and Linux platforms.
For Windows, the Access Bridge spans both the Windows and Java environments. Part of it is a Java class, and the other part is a set of Windows Dynamic Link Libraries (DLLs). When a Windows-based assistive technology runs, it interacts with the DLL portion of the Access Bridge. The Bridge's class then communicates with the Accessibility API and Java Accessibility Utilities through the Java Virtual Machine. (In order to use the JAB, you need to have the Java Accessibility Utilities installed.)
The GNOME desktop on UNIX and Linux platforms is highly customizable and provides APIs and libraries to allow developers to quickly create accessible applications and assistive technologies. GNOME Accessibility Architecture is contributed by Sun Microsystems to the GNOME open source project.
Java Accessibility Helper
The Java Accessibility Helper examines an Abstract Window Toolkit (AWT) or Swing-based application for accessibility and is capable of running various tests against an application. This important tool helps to identify problems with lack of accessibility support in a Java application.
Further reading
For more information about the JAAPI, check out the following resources:
Peter V. Mikhalenko is a Sun certified professional who works for Deutsche Bank as a business consultant.
Do you need help with Java, C, or C++? 





Leave a comment