diff options
author | Simon Rettberg | 2021-08-11 16:16:40 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-08-11 16:16:40 +0200 |
commit | 4c60b93a7cc14f740ad376d4f6bc4a54e8c47eef (patch) | |
tree | 9d45216766f852be9eb7724c196fb55475fa3862 /dozentenmodul | |
parent | [client] Add optional FlatLaf Light and Dark look and feel (diff) | |
download | tutor-module-4c60b93a7cc14f740ad376d4f6bc4a54e8c47eef.tar.gz tutor-module-4c60b93a7cc14f740ad376d4f6bc4a54e8c47eef.tar.xz tutor-module-4c60b93a7cc14f740ad376d4f6bc4a54e8c47eef.zip |
[client] Print error message if no LookAndFeel can be loaded
Diffstat (limited to 'dozentenmodul')
-rwxr-xr-x | dozentenmodul/src/main/java/org/openslx/dozmod/App.java | 8 |
1 files changed, 6 insertions, 2 deletions
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); } } |