Browse Source

Catch exceptions thrown during GUI initialization.

This is a workaround for an UnsupportedOperationException thrown when using X2Go, due to PERPIXEL_TRANSLUCENT translucency being unsupported in splashDialog.setBackground(). We could choose to use a different version of the splash screen with an opaque background in these cases, but it is low priority.
add-atstates-index
CalDescent 3 years ago
parent
commit
c9596fd8c4
  1. 24
      src/main/java/org/qortal/gui/Gui.java

24
src/main/java/org/qortal/gui/Gui.java

@ -23,17 +23,21 @@ public class Gui {
private SysTray sysTray = null; private SysTray sysTray = null;
private Gui() { private Gui() {
this.isHeadless = GraphicsEnvironment.isHeadless(); try {
this.isHeadless = GraphicsEnvironment.isHeadless();
if (!this.isHeadless) {
try { if (!this.isHeadless) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); try {
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
| UnsupportedLookAndFeelException e) { } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
// Use whatever look-and-feel comes by default then | UnsupportedLookAndFeelException e) {
// Use whatever look-and-feel comes by default then
}
showSplash();
} }
} catch (Exception e) {
showSplash(); LOGGER.info("Unable to initialize GUI: {}", e.getMessage());
} }
} }

Loading…
Cancel
Save