Support systems settings for high contrast for all user interface controls and client area content.
This page provides specific examples to implement the Software techniques for high contrast using Java Swing. For an explanation of this requirement, see Rationale for system settings for high contrast in the Software checklist.
The following techniques are the minimum required to meet Checkpoint 4.3 from the IBM Software Accessibility Checklist:
- Software must determine if the user has specified high contrast and ensure use the color scheme specified by the high contrast setting is supported throughout the software.
- If system settings are not automatically inherited, provide an option to use the system settings for high contrast instead of the program settings.
Examples for Java developers
If the software uses the Windows Pluggable Look and Feel (PLAF), provided with JFC, and standard JFC components, the controls and text will automatically inherit the Windows system settings for high contrast.
If the software does not use the Windows Pluggable Look and Feel (PLAF), is cross-platform or uses custom components then you will need to create a PLAF. You can create the new PLAF from the Windows PLAF. The PLAF uses the Java Native Interface (JNI) to access a Dynamic Link Library (DLL) that you will create. This DLL will need to access system high contrast settings for each component by calling the
Even if the software provides custom settings for displaying content, it must still provide a way for users to choose the system settings instead of custom settings provided by the program.
The techniques above are required; the following techniques are recommended to enhance accessibility:
- Automatically inherit changes in high contrast settings so users do not have to stop and restart the application to get the new setting. The Windows PLAF will automatically inherit changes in the high contrast settings.
- For operating systems and components that do not have corresponding standard system controls you can create high contrast capabilities that the user can set. (
Javax.Swing.Colorchooser - JColorChooser).
- Default text size to a minimum of 10 even if other font sizes less than this are available.
- Default contrast ratio to a minimum of 200:1.
There are no unique steps for testing high contrast for Java Swing. Follow the required test techniques for system settings for high contrast in Software checkpoint 4.3.
©2009, 2013 IBM Corporation
Last updated January 1, 2013.