From a38e14101f3e5bb4f2a758eff6cdcd87c9d99356 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Tue, 21 Jul 2020 16:39:54 +0200 Subject: Modified Autostart capability on Java Versions > 1.8 --- .../main/java/at/gv/egiz/bku/webstart/Launcher.java | 1 - .../java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java index ee951a4b..026a947f 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java @@ -135,7 +135,6 @@ public class Launcher implements BKUControllerInterface { } private Configurator config; private Container server; -// private BasicService basicService; private StatusNotifier status; private Autostart autostart; diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java index 1b9996fc..c12ffde0 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java @@ -152,14 +152,17 @@ public class MOCCAIcon implements StatusNotifier, ActionListener, ItemListener { Menu settingsMenu = new Menu(messages.getString(LABEL_SETTINGS)); menu.add(settingsMenu); - CheckboxMenuItem autostartItem = new CheckboxMenuItem( - messages.getString(LABEL_AUTOSTART)); - autostartItem.addItemListener(this); - autostartItem.setActionCommand(COMMANDS.AUTOSTART_COMMAND.name()); - autostartItem.setState(controller.isAutostartEnabled()); - autostartItem.setEnabled(controller.isAutostartPossible()); - settingsMenu.add(autostartItem); - + // only add autostart for older java versions + String version = System.getProperty("java.version"); + if (version.startsWith("1.")) { + CheckboxMenuItem autostartItem = new CheckboxMenuItem( + messages.getString(LABEL_AUTOSTART)); + autostartItem.addItemListener(this); + autostartItem.setActionCommand(COMMANDS.AUTOSTART_COMMAND.name()); + autostartItem.setState(controller.isAutostartEnabled()); + autostartItem.setEnabled(controller.isAutostartPossible()); + settingsMenu.add(autostartItem); + } menu.addSeparator(); MenuItem shutdownItem = new MenuItem( -- cgit v1.2.3