From 4c60b93a7cc14f740ad376d4f6bc4a54e8c47eef Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 11 Aug 2021 16:16:40 +0200 Subject: [client] Print error message if no LookAndFeel can be loaded --- dozentenmodul/src/main/java/org/openslx/dozmod/App.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dozentenmodul/src') diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java index 50c2add1..a6f4b580 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java @@ -200,7 +200,7 @@ public class App { UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); Config.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); } - } catch (Exception e1) { + } catch (Throwable e1) { try { LOGGER.error("Something went wrong with the chosen 'LookAndFeel'. Falling back to default 'SystemLookAndFeel'"); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); @@ -208,7 +208,11 @@ public class App { if(Config.getLookAndFeel() == null) { Config.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } - } catch (Exception e) { + } catch (Throwable e) { + LOGGER.error("Cannot select system look and feel", e); + LOGGER.error("----------------------------------"); + LOGGER.error("Cannot initialize GUI. Make sure you have the non-headless version of Java installed."); + System.exit(1); } } -- cgit v1.2.3-55-g7522