Adding JPopupMenu to the TrayIcon
问题 I want to add JPopupMenu to the task bar as a TrayIcon ( i.e systemTray.add(trayIcon) ) but I haven't found a way to do so.From the docs the constructor of TrayIcon looks like : public TrayIcon(Image image, String tooltip, PopupMenu popup) Is there any way I can do this ? 回答1: This is a known problem. There is a bug report, which contains the outline of a workaround. I've adapted that below: // Build your popup menu final JPopupMenu trayPopup = new JPopupMenu(); // I'm using actions, there