JAL-3608 Changes from code review CR-JAL-236
authorBen Soares <b.soares@dundee.ac.uk>
Tue, 7 Jul 2020 23:47:55 +0000 (00:47 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Tue, 7 Jul 2020 23:47:55 +0000 (00:47 +0100)
src/jalview/bin/Jalview.java

index 08c12d6..78d8dde 100755 (executable)
@@ -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)
     {