From: rnayabed Date: Mon, 01 Mar 2021 10:31:22 +0530 Subject: System Tray - Click to show instead of right click and selecting --- System Tray - Click to show instead of right click and selecting --- --- 'a/src/main/java/com/stream_pi/server/controller/Controller.java' +++ b/src/main/java/com/stream_pi/server/controller/Controller.java @@ -424,13 +424,6 @@ public class Controller extends Base imp Platform.setImplicitExit(false); PopupMenu popup = new PopupMenu(); - - MenuItem showItem = new MenuItem("Show"); - showItem.addActionListener(l->{ - Platform.runLater(()->{ - getStage().show(); - }); - }); MenuItem exitItem = new MenuItem("Exit"); exitItem.addActionListener(l->{ @@ -439,8 +432,6 @@ public class Controller extends Base imp Platform.exit(); }); - popup.add(showItem); - popup.addSeparator(); popup.add(exitItem); TrayIcon trayIcon = new TrayIcon( @@ -449,6 +440,8 @@ public class Controller extends Base imp popup ); + trayIcon.addActionListener(l-> Platform.runLater(()-> getStage().show())); + trayIcon.setImageAutoSize(true); this.trayIcon = trayIcon;