summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-08-11 16:16:40 +0200
committerSimon Rettberg2021-08-11 16:16:40 +0200
commit4c60b93a7cc14f740ad376d4f6bc4a54e8c47eef (patch)
tree9d45216766f852be9eb7724c196fb55475fa3862
parent[client] Add optional FlatLaf Light and Dark look and feel (diff)
downloadtutor-module-4c60b93a.tar.gz
tutor-module-4c60b93a.tar.xz
tutor-module-4c60b93a.zip
[client] Print error message if no LookAndFeel can be loaded
-rwxr-xr-xdozentenmodul/src/main/java/org/openslx/dozmod/App.java8
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);
}
}