| Java Sun >
Guidelines Home Page > Java Look and Feel Design Guidelines >
Part II: Fundamental Java Application Design >
3: Design Considerations >
Designing for Accessibility
Accessibility refers to the removal of barriers that prevent people with disabilities from participating in social, professional, and practical life activities. In software design, accessibility requires taking into account the needs of people with functional differences: for example, users who are unable to operate a conventional mouse or keyboard or users who cannot process information using traditional output methods.
Java Accessibility Helper, a utility to aid you in assessing how well your application supports the needs of people with disabilities, is available on the book's companion CD-ROM.
Accessibility provides a competitive advantage, increasing sales as well as the opportunities for employment, independence, and productivity for the approximately 750 million people worldwide with disabilities. Moreover, designing for accessibility provides potential benefits beyond enabling people with disabilities:
Consider the concept of electronic curb cuts: In the real world, cuts made in the sidewalk at intersections enable wheelchairs to exit the sidewalk and cross the intersection. Those curb cuts are also great for baby strollers, skateboards, and elderly people with only minor disabilities. In the same way, many software accessibility features make everyone more productive.
Many countries are instituting legislation (such as the Americans With Disabilities Act in the United States) that makes access to information, products, and services mandatory for individuals with special needs. In these countries, government and academic institutions are required to purchase and support technologies that maximize accessibility. For example, in the United States, Section 508 of the Federal Rehabilitation Act requires all federal contracts to include solutions for employees with disabilities. The international community of people with disabilities is also successfully pressuring companies to sell accessible software.
For a list of additional reading, see Design for Accessibility.
The Java look and feel standards in this book take into account the needs of users with functional limitations. The standards cover how to use colors, fonts, animation, and graphics. By following these standards, you will be able to meet the needs of most of your users.
Java look and feel standards are identified throughout the book by this symbol.
An accessible name and description property should be provided for each component in your application. These properties enable an assistive technology, such as a screen reader, to interact with the component.
As a developer, you usually do not have to set these properties directly. Commonly, the accessible name and descriptions are picked up automatically from a component's label or tool tip. (Furthermore, Java Accessibility Helper, the utility provided on the book's companion CD-ROM, checks for this information.) For details, see "Developing Accessible JFC Applications" at
Whenever possible, use tool tips and labels instead of setting accessibility properties directly. This practice makes it easy to extract accessibility information and localize the accessibility properties. If you set accessibility properties directly and add unique strings to your application, be sure to store the new information in your application's resource bundle. When the bundle is localized, the accessibility values are included.
accessibleName property provides a name for a component and distinguishes it from other components of the same type. It enables assistive technologies to provide users with the name of the component that has input focus.
For components such as labels, buttons, and menu items that contain noneditable text, the
accessibleName property is set automatically to the text. Other types of components should have corresponding
JLabel objects. Use the
JLabel.setLabelFor method to instruct the target object to inherit its accessible name from the label.
All components should have tool tips. They automatically set the components'
accessibleDescription property, which provides information such as how a component works.
The Java Accessibility Helper utility can be used to determine whether
accessibleName properties and other API information are properly implemented in your application. Java Accessibility Helper v.0.3 is included on the book's companion CD-ROM.
For more information on the Java Accessibility API and the Java Accessibility Utilities package, see Support for Accessibility.
You should provide mnemonics and keyboard shortcuts throughout your application. A mnemonic is an underlined alphanumeric character that shows users which key to press (in conjunction with the Alt key) to activate a command or navigate to a component.
The dialog box in Figure 17 shows the use of mnemonics for a text field, checkboxes, radio buttons, and command buttons. For example, if keyboard focus is within the dialog box, pressing Alt-W moves keyboard focus to the Whole Word checkbox and selects it.
Click here to view the corresponding code for Figure 17 (also available on the book's companion CD-ROM).Figure 17 Mnemonics in a Dialog Box
In cases where you can't add a mnemonic to the component itself, as in the text field in the preceding figure, you can place the mnemonic in the component's label. For more information on mnemonics, see Mnemonics.
labelFor property should always be used to associate a label with another component so that the component becomes active when the label's mnemonic is activated. This practice eliminates the need to set an
accessibleName property programmatically.
Keyboard shortcuts are keystroke combinations (usually a modifier key and a character key, like Control-C) that activate menu items from the keyboard even if the relevant menu is not currently displayed. (For more on keyboard shortcuts, see Keyboard Shortcuts.)
You can also assist users who navigate via the keyboard by assigning initial keyboard focus and by specifying a tab traversal order. Keyboard focus indicates where the next keystrokes will take effect. For more information, see Keyboard Focus.
Tab traversal order is the sequence in which components receive keyboard focus on successive presses of the Tab key. In most cases, the traversal order follows the reading order of the users' locale. For more information on tab traversal order, see Tab Traversal Order.
You should try out the application with a variety of users to see how well it provides for accessibility. Low-vision users, for example, are sensitive to font sizes and color, as well as layout and context problems. Blind users are affected by interface flow, tab order, layout, and terminology. Users with mobility impairments can be sensitive to tasks that require an excessive number of steps or a wide range of movement.
|Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.