I have an TrayIcon which occasionally displays popup/balloon messages via displayMessage(). The TrayIcon itself has an ActionListener which works fine. As per the docs, on at least some platforms (eg Win 8), a click on the message bubble itself fires the icon's listener event.
So far so good, but I would like to implement separate behaviour for
- The user clicking the icon itself in the system tray
- The user clicking the message bubble (in this case, do nothing)
Is there an elegant way of doing this?
I thought there might be a property of the ActionEvent passed to ActionListener.actionPerformed() which could distinguish between the two sources of a click, but can't find one.
Any ideas? The app will only run on Windows, if that helps.