How to detect the color information of theme when the windows high contrast mode is on

113 Views Asked by At

I am using the following code to detect Windows high contrast mode. I want to switch the image of the JButton to support high contrast when they are using a different theme such as black on white or white on black.

Toolkit toolkit = Toolkit.getDefaultToolkit();
Boolean highContrast = (Boolean)toolkit.getDesktopProperty("win.highContrast.on");

So my question is, how can I detect the color information (at least the background color) of the theme when high contrast mode is on?

0

There are 0 best solutions below