public
Created

  • Download Gist
repro.java
Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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");
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.