Created
December 19, 2012 16:46
-
-
Save rdp/4338167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.awt.event.*; | |
class repro { | |
public static void main(String[] args) throws Exception { | |
SystemTray tray = java.awt.SystemTray.getSystemTray(); | |
Image image = java.awt.Toolkit.getDefaultToolkit().getImage(""); | |
TrayIcon trayIcon = new TrayIcon(image, "name", null); | |
tray.add(trayIcon); | |
trayIcon.addActionListener(new ActionListener() { | |
public void actionPerformed(ActionEvent evt) { | |
System.out.println("in here " + evt.getActionCommand() + " " + evt.getModifiers() + " " + evt.paramString() + " " + evt.getID()); | |
} | |
}); | |
trayIcon.displayMessage("title", "try clicking within the baloon, but not the x, then double clicking the tray icon", TrayIcon.MessageType.INFO); | |
System.out.println("try clicking within the balloon message, or double clicking, both seem to generate the same event"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment