Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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);
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