Java Reference
In-Depth Information
CHAPTER 22
■ ■ ■
Accessibility
A standard part of the Swing framework is support for assistive technologies. These technologies
allow your Swing-based programs to be accessible to those with physical challenges. Some
users need screen readers, audio cues, or just an input mode that doesn't require the mouse.
Mouse-less input is typically through the keyboard, but it also could be through specialized
input devices, such as those that are voice-activated.
Users don't need to be physically challenged to take advantage of options you, as the
developer, can use to make your programs more accessible. For example, you might add tooltip
text, which users can see by resting their mouse over the component. Limited-vision users
taking advantage of accessibility devices could rely on that text to describe the component with
a screen reader. Other options include keyboard accelerators and menu mnemonics, which
allow users to navigate around the screen and activate actions with minimal hand movement.
This chapter offers some suggestions to help you create programs that follow federal
guidelines in the United States, known as Section 508 Accessibility Requirements. For details
on these requirements, refer to Accessibility for Everybody: Understanding the Section 508
Accessibility Requirements , by John Paul Mueller (Apress, 2003; ISBN 1-59059-086-4). Sun also
offers a resource at http://www.sun.com/access/background/laws.html , which includes references
to international resources, as well as those in the United States. And, of course, there is the JFC
Assistive Technologies home page, at http://java.sun.com/products/jfc/accessibility/ .
Accessibility Classes
The javax.accessibility package is both the most and least used package. Provided you
configure your Swing components properly, everything happens behind the scenes. When a
user taking advantage of an accessibility device runs the program, the Java Accessibility API
steps in and provides the necessary information to the device. For instance, when creating an
ImageIcon , there are two sets of constructors: those without a description argument and those
with a description argument.
// Without description argument
public ImageIcon()
public ImageIcon(Image image)
public ImageIcon(String filename)
public ImageIcon(URL location)
public ImageIcon(byte imageData[])
805
Search WWH ::




Custom Search