From: Ben Soares Date: Tue, 7 Jul 2020 23:47:55 +0000 (+0100) Subject: JAL-3608 Changes from code review CR-JAL-236 X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~16^2^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6d6e715f1d28a12ddd61c43aec4f084a8c9b1c5b;p=jalview.git JAL-3608 Changes from code review CR-JAL-236 --- diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 08c12d6..78d8dde 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -893,26 +893,22 @@ public class Jalview private static boolean setCrossPlatformLookAndFeel() { - boolean set = false; - try - { - UIManager.setLookAndFeel( - UIManager.getCrossPlatformLookAndFeelClassName()); - set = true; - } catch (Exception ex) - { - System.err.println("Unexpected Look and Feel Exception"); - ex.printStackTrace(); - } - return set; + return setGenericLookAndFeel(false); } private static boolean setSystemLookAndFeel() { + return setGenericLookAndFeel(true); + } + + private static boolean setGenericLookAndFeel(boolean system) + { boolean set = false; try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + UIManager.setLookAndFeel( + system ? UIManager.getSystemLookAndFeelClassName() + : UIManager.getCrossPlatformLookAndFeelClassName()); set = true; } catch (Exception ex) {