Make sure AccessibleName is set for all components (mainly custom
components) .
Make sure AccessibleDescription is set for all components -when the context
is not obvious from AccessibilityName use a ToolTip. See the FAQ for more detail.
Set labelFor for linking between JLabels and components.
Ensure a logical TAB order for keyboard navigation and initial focus.
Assign mnemonics for focusable components.
Custom components need to explicitly add implements Accessible and provide
the content of AccessibleContext
Group related components together in a JPanel and set A11yDescription and A11yName.
Avoid hard coding color and fonts
Use a11y module, Accessibility Helper 02 and Ferret (A11y utility) for teststing
Test TAB-order and mnemonics manually (ESC, Enter too).
Each row in an Accessibility Helper report SHOULD be commented on (FIXED, FINE, etc).
Create updated screenshots and link to th UI module
Ensuring and Verifying Basic Application Accessibility - (author Jeff Dunn)
The following are quick tips on how to make Java[tm] applications accessible. A full
set of guidelines, which also contain code snippets as well as information on how to build
custom components, are available in IBM's
Guidelines for Writing Accessible Applications Using 100% Pure Java[tm] and The Java Tutorial. A
condensed version of these two can be found in Developing
Accessible JFC Applications.
Use the JFC(Swing) UI components to build applications.
The built-in
accessibility support provided by the Java[tm] 2 Platform makes it possible to produce
access-friendly applications in an efficient and timely manner.
Make sure an AccessibleName is set on all components in an application.
While an AccessibleName is always required, it is not always necessary for the developer
to explicitly set this property. Components such as labels, buttons, and menu items which
generally are named will have the AccessibleName property automatically set to the text
they contain. In situations where a label names another component, e.g. a label naming a
text field, AccessibleName inherits what is set in the LabelFor property (see the tip
regarding LabelFor below). If the previous suggestions do not provide an object with a
sufficient name, as with a .gif file for example, the value of the AccessibleName property
can be programmatically set to any string. Setting the accessible name allows assistive
technologies to provide the user with the name of the component that has the input focus.
This is always required, even if a tooltip or an accessible description is set on the
component.
Make sure an AccessibleDescription is set on all components whose context is not
obvious from their names.
If the purpose of a component is obvious from its name, this step can be skipped. If more
information is required, consider adding a tooltip to the component, since the
AccessibleDescription will default to the contents of the tooltip. If a tooltip is not
appropriate or if its contents are insufficient for a user with a disability, the value of
the AccessibleDescription property should be set. Setting this accessible description
allows assistive technologies to provide more detailed information about a component,
usually in response to a user's request.
Set the LabelFor properties on applicable components.
Setting this property creates a linkage between labels and the items they are labeling.
This is very important in the case of a JLabel that appears in front of a blank editable
text field, where the label is telling the user what the editable text field is. Linking
such items allows assistive technologies to discover and identify the editable textfield
for the user.
Layout interactive components in a logical tab navigation order.
Many users with disabilities are unable to use a mouse, and rely completely on the
keyboard to access applications. A logical order makes it easier for keyboard-only users
to track their position in the interface. Whenever possible, adopt a navigation flow
similar to the user's locale. For example, English has a left to right, top to bottom flow
structure.
Assign mnemonics to all of the essential functions of an application.
When a user relies completely on the keyboard to drive a program, quick and easy access to
important parts of the interface (independent of where the user is in the tab order) is
needed. Mnemonics allow the user to navigate directly to interactive components. This
bypasses the need to navigate across components that are not of interest.
When building Custom Components, keep in mind that the JComponent class, itself, does
not implement the Accessible interface.
Therefore, instances of its direct subclasses are not accessible. If a custom component
inherits directly from JComponent, it must explicitly implement the Accessible interface.
JComponent does have an accessible context (called AccessibleJComponent), that implements
the AccessibleComponent interface and provides a minimal amount of accessible information.
An accessible context for custom components can be provided by creating a subclass of
AccessibleJComponent and overriding important methods.
Avoid hard coding color and font properties.
It is important to respect users' needs to customize these settings, as they may be
critical in their ability to read and understand what is on the screen.
Use the Java[tm] Accessibility Helper to determine how access friendly your program
is.
The Java
Accessibility Helper aids Java software developers in making their JFC-based programs
accessible to persons with disabilities. The Helper generates a report that includes a
prioritized list of problems and potential problems with the application being tested. For
example, the Helper verifies that all input fields in an application can be reached using
only the keyboard.
AccessibilityTester from a11y.netbeans.org: The
NetBeans AccessibilityTester can be used to test forms in the Form Editor(or
to test application. Install the a11y.nbm
as a module in NetBeans to add the test action to the toolbar.
Accessibility Helper from
Sun.There are known problems with the current version; we recommend using version
02 for testing NetBeans.
Java
Accessibility Utilities from Sun. Ferret is a good tool for doing quick assesment. The
a11yprop.zip
contains Windows .bat files and a working accessibility.properties file for use with these
tools. Unzip this file into the JDK_HOME/jre/lib directory.