Accessibility for Web Developers

Guideline 8

Guideline 8: Ensure direct accessibility of embedded user interfaces

Scripts, applets, and other objects that have a user interface should be compatible with assistive technologies, such as screen readers, and screen magnifiers. This guideline has 1 checkpoint.

Important - Priority 1 Checkpoint 8.1 Make programmatic elements such as scripts and applets directly accessible or compatible with assistive technologies

This checkpoint is a priority 1 checkpoint if functionality is crucial to the understanding or context of the document, and not presented elsewhere. Otherwise, it's a Priority 2 checkpoint. Programmable objects, such as applets, movies, and scripts, which have their own interface, must be accessible (see guideline 6.4). If the interface cannot be made accessible due to limitations in the type of object, then an alternative accessible solution should be provided. Flash MX addresses some basic accessibility issues, such as allowing you to provide text equivalents for images, but still falls short of offering a truly accessible interface.

Java supports accessibility through the javax.accessibility package, available in all releases of the Java 2 platform. An AccessibleContext object provides information and functionality necessary to ensure a particular component is accessible. JFC/Swing! components that don't have editable text, have accessible names and descriptions set automatically. In circumstances where a component does not have an accessible name or description, it can be provided directly through the object's AccessibleContext.

AccessibleContext context = email.getAccessibleContext();
context.setAccessibleDescription("The email address of a friend");

Objects should be independent of an input device. This is achieved in Java by providing mnemonics and keyboard accelerators that allow objects to be controlled through the keyboard as well as a pointing device. The setLabelFor method of the Label component allows you to explicitly bind a label to a particular component.

' Associate a label with a component
JLabel label = new JLabel("Enter your username:");

' Set a mnemonic for a menu
JMenu menu = new JMenu("File");

' Set a keyboard accelerator for a menu item
JMenuItem item = new JMenuItem("Open");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.SHIFT_MASK));

Documents with scripts should be accessible if scripting is not supported, or has been switched off (see guideline 6.3).

Further Reading

You might also like...


About the author

Gez Lemon United Kingdom

I'm available for contract work. Please visit Juicify for details.

Interested in writing for us? Find out more.


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”