skip to main content
Programmer's documentation > Developing with the JViews Gantt SDK > Accessible Gantt and schedule charts > High contrast mode
 
High contrast mode
A high contrast mode supports people with low vision. On Microsoft® Windows® systems, high contrast mode is available from the Control Panel; in the Ease of Access Center in Windows 7 and equivalent facilities in other versions of Windows.
To detect high contrast mode in Java™, use the IlvSwingUtil.isHighContrastMode utility. The high contrast mode affects all standard Swing GUI elements (JPanel, JButton, and so on). Custom Swing elements might need special code to adapt to high contrast mode.
In JViews Gantt, you can set larger fonts and brighter colors by designing a special cascading style sheet (CSS) for this mode. You can use the cascading feature to combine different CSS files. A chart might have a style sheet for everything except colors and fonts, a style sheet defining the colors and fonts for normal mode, and a different style sheet defining brighter colors and larger fonts for high contrast mode. The choice of style sheet can be implemented by checking IlvSwingUtil.isHighContrastMode.
if (IlvSwingUtil.isHighContrastMode()) {
  ganttChart.setStyleSheets(new String[] { "main.css", "highContrast.css" });
} else {
  ganttChart.setStyleSheets(new String[] { "main.css", "normalContrast.css" });
}

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.