From 6d6e715f1d28a12ddd61c43aec4f084a8c9b1c5b Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 8 Jul 2020 00:47:55 +0100 Subject: [PATCH] JAL-3608 Changes from code review CR-JAL-236 --- src/jalview/bin/Jalview.java | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) 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) { -- 1.7.10.2