From ce2ac269a3e9b6e52f1e1c4df24f8d5a59ad6933 Mon Sep 17 00:00:00 2001 From: hansonr Date: Mon, 4 Feb 2019 08:50:46 -0600 Subject: [PATCH] MIG -- explicitly sets Java9 switch to true for SwingJS --- .../miginfocom/swing/SwingComponentWrapper.java | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/srcjar/net/miginfocom/swing/SwingComponentWrapper.java b/srcjar/net/miginfocom/swing/SwingComponentWrapper.java index 46a78fd..2b6f1aa 100644 --- a/srcjar/net/miginfocom/swing/SwingComponentWrapper.java +++ b/srcjar/net/miginfocom/swing/SwingComponentWrapper.java @@ -136,17 +136,17 @@ public class SwingComponentWrapper implements ComponentWrapper } } - private static boolean isJava9orLater; - static { - try { - // Java 9 version-String Scheme: http://openjdk.java.net/jeps/223 - StringTokenizer st = new StringTokenizer(System.getProperty("java.version"), "._-+"); - int majorVersion = Integer.parseInt(st.nextToken()); - isJava9orLater = majorVersion >= 9; - } catch (Exception e) { - // Java 8 or older - } - } + private static boolean isJava9orLater = true; +// static { +// try { +// // Java 9 version-String Scheme: http://openjdk.java.net/jeps/223 +// StringTokenizer st = new StringTokenizer(System.getProperty("java.version"), "._-+"); +// int majorVersion = Integer.parseInt(st.nextToken()); +// isJava9orLater = majorVersion >= 9; +// } catch (Exception e) { +// // Java 8 or older +// } +// } // /** Cache. // */ @@ -226,6 +226,7 @@ public class SwingComponentWrapper implements ComponentWrapper c.getPreferredSize(); // To defeat a bug where the minimum size is different before and after the first call to getPreferredSize(); prefCalled = true; } + return c.getMinimumSize().width; } @Override -- 1.7.10.2