Java Reference
In-Depth Information
Table 22-1. AccessibleContext Properties (Continued)
Property Name
Data Type
Access
accessibleIcon
AccessibleIcon
Read-only
accessibleIndexInParent
int
Read-only
accessibleName
String
Read-write bound
accessibleParent
Accessible
Read-write
accessibleRelationSet
AccessibleRelationSet
Read-only
accessibleRole
AccessibleRole
Read-only
accessibleSelection
AccessibleSelection
Read-only
accessibleStateSet
AccessibleStateSet
Read-only
accessibleTable
AccessibleTable
Read-only
accessibleText
AccessibleText
Read-only
accessibleValue
AccessibleValue
Read-only
locale
Locale
Read-only
As Table 22-1 shows, there are several other classes found in the javax.accessibility
package. However, typically, you don't need to worry about them, provided that you create
your components and screens to be accessible.
Creating Accessible Components
This section presents some hints to help you create applications that will be accessible when
used with assistive technologies. This is not meant to be an exhaustive list, but it does provide
an overview of some helpful techniques.
As a first task, try to use your program without a mouse. Do your menus support accelerators
and mnemonics? Do your buttons have mnemonics associated with them? Do your text
fields have labels associated with them via the setLabelFor() method, and does each
label have a mnemonic?
Make sure your components have a short string associated with them. If a component,
such as an image-only button, doesn't have a string, call the setAccessibleName() method
of the AccessibleContext . Remember to localize this name if your program is targeting
an internationalized audience.
Work with tooltip text wherever possible. If it is not appropriate to have tooltip text with
a component, be sure to call setAccessibleDescription() .
Are your custom components accessible? If you've subclassed JComponent , that class
doesn't implement the Accessible interface. But, if you've subclassed JPanel , it does.
However, even though JPanel implements the interface, your component might not be
providing the necessary accessibility information. Consider having your custom
AccessibleContext extend JComponent.AccessibleJComponent when appropriate.
Search WWH ::




Custom Search