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 --- .../java/at/gv/egiz/bku/webstart/gui/MOCCAIcon.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui') 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