Why my color theme change when I change java 8 version (from 8u45 to 8u171)?

Gabriel D :

I have an application that I can launch with two differents versions of java:

  • with 8u45, my application get shade of blue application blue
  • with 8u171, my application get shade of white application white

I checked the lookandfile init in the application but it doesn't seem to affect this behaviour.

I use Swing and Jide 3.6.0 librairy

Has someone an idea why this behavior is happening when I upgrade java version from 8u45 to 8u171 ?

Thanks for your help :)

Edit :

The application is running on Windows.

I use com.sun.java.swing.plaf.windows.WindowsLookAndFeel, given by UIManager.getLookAndFeel()

Nicolas :

It is linked to the system property os.name. Since windows 8.1, the GetVersionEx function has been deprecated whereas old version of java 8 such as 8u45 are based on this function to feed this system property.

For more information : https://docs.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1

So that when you launch a jvm with this version of java, it will consider windows 8.1 os name and apply its skin. A quick test can support this statement by displaying System.getProperty("os.name") with the old jdk 8u45 : System.getProperty("os.name")

I suppose later version of java 8 fixed this issue and retrieve the good os name. For example with jdk u171 :

System.getProperty("os.name")

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=154564&siteId=1