FileChooser: use Windows system icons in Java 18+ 32bit (issue #403)

only Java 17 32bit does not use Windows system icons because of:
https://bugs.openjdk.java.net/browse/JDK-8277299
This commit is contained in:
Karl Tauber
2021-12-31 12:59:22 +01:00
parent 3755593c14
commit e5956900ea
2 changed files with 6 additions and 1 deletions

View File

@@ -275,7 +275,10 @@ public class FlatFileChooserUI
private boolean doNotUseSystemIcons() {
// Java 17 32bit craches on Windows when using system icons
return SystemInfo.isWindows && SystemInfo.isJava_17_orLater && !SystemInfo.isX86_64;
// fixed in Java 18+ (see https://bugs.openjdk.java.net/browse/JDK-8277299)
return SystemInfo.isWindows &&
SystemInfo.isX86 &&
(SystemInfo.isJava_17_orLater && !SystemInfo.isJava_18_orLater);
}
//---- class FlatFileView -------------------------------------------------

View File

@@ -52,6 +52,7 @@ public class SystemInfo
public static final boolean isJava_11_orLater;
public static final boolean isJava_15_orLater;
/** @since 2 */ public static final boolean isJava_17_orLater;
/** @since 2 */ public static final boolean isJava_18_orLater;
// Java VMs
public static final boolean isJetBrainsJVM;
@@ -93,6 +94,7 @@ public class SystemInfo
isJava_11_orLater = (javaVersion >= toVersion( 11, 0, 0, 0 ));
isJava_15_orLater = (javaVersion >= toVersion( 15, 0, 0, 0 ));
isJava_17_orLater = (javaVersion >= toVersion( 17, 0, 0, 0 ));
isJava_18_orLater = (javaVersion >= toVersion( 18, 0, 0, 0 ));
// Java VMs
isJetBrainsJVM = System.getProperty( "java.vm.vendor", "Unknown" )