简体   繁体   中英

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

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

  • with 8u45, my application get shade of blue应用蓝
  • with 8u171, my application get shade of 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()

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")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM