How do I detect if a display is in High Contrast mode?

Posted by banjollity on Stack Overflow See other posts from Stack Overflow or by banjollity
Published on 2009-06-30T09:32:54Z Indexed on 2010/05/09 3:58 UTC
Read the original article Hit count: 305

I'm testing my company's established Swing application for accessibility issues. With high contrast mode enabled on my PC certain parts of this application are rendered properly (white-on-black) and some incorrectly (black-on-white).

The bits that are correct are the native components (JButton, JLabel and whatnot) and third party components from the likes of JIDE. The incorrect bits are custom components and renderers developed in-house without consideration for high-contrast mode.

Clearly it's possible to detect when high-contrast mode is enabled. How do I do this?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing