From: hansonr Date: Mon, 4 Feb 2019 14:50:46 +0000 (-0600) Subject: MIG -- explicitly sets Java9 switch to true for SwingJS X-Git-Tag: Release_2_11_4_0~45^2~18^2~253 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ce2ac269a3e9b6e52f1e1c4df24f8d5a59ad6933;p=jalview.git MIG -- explicitly sets Java9 switch to true for SwingJS --- 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