L'impostazione basilare/minima di un menù di popup ad un TrayIcon è quella descritta nel tutorial How to Use the System Tray
Ovvero:
trayIcon.setPopupMenu(popup);
Una riga. Stop. Tutto qui (niente listener, test, eventi ...).
L'impostazione basilare/minima di un menù di popup ad un TrayIcon è quella descritta nel tutorial How to Use the System Tray
Ovvero:
trayIcon.setPopupMenu(popup);
Una riga. Stop. Tutto qui (niente listener, test, eventi ...).
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet
Eh beh ... hai ragione pure tu!
Comunque qui Using JPopupMenu in TrayIcon fa vedere appunto l'uso di setInvoker e ne spiega anche il motivo. Sebbene mi pare di capire che comunque non è tutto "rose e fiori" con JPopupMenu.
Andrea, andbin.dev – Senior Java developer – SCJP 5 (91%) • SCWCD 5 (94%)
java.util.function Interfaces Cheat Sheet — Java Versions Cheat Sheet