JDK-6303746 : PIT: ActionEvent is not at all triggered when clicking TrayIcon message on Win2000
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2005-07-29
  • Updated: 2011-01-19
  • Resolved: 2005-08-16
Related Reports
Relates :  
Relates :  
Relates :  
Description
I have added a tray icon to the system tray and I am displaying a message on Win2000 by calling TrayIcon.displayMessage(). When I click the message, the message disappears but no action event is triggered. As far as I understand, clicking the message should actually trigger ActionEvent.

This is reproducible only with current AWT PIT build (b47) and on previous builds, the display message itself was not shown. This is happening only on Win2000 and not on WinXP.

I have attached a sample test. Run the test. You would see a tray icon being added to the system tray. Click on 'DisplayMessage' button. Check whether an action event is shown on the console. If not shown, it is a bug.

Comments
EVALUATION I haven't found any place in the specification about if ActionEvents must be fired when user clicks on the message or not. Such events are platform-dependant, so I'm closing this CR as not a defect.
16-08-2005

EVALUATION On Windows platforms AWT uses completely native API to work with tray icons. In particular, all the events fired to Java code are caused by some native events or notifications sent by the system. When user clicks on the displayed message NIN_BALLOONUSERCLICK notification should be sent to the tray icon. However, according to MSDN it is true only on WinXP and later systems: "If a user passes the mouse pointer over an icon with which a balloon ToolTip is associated, the version 6.0 Shell (Windows XP) sends the following messages: * NIN_BALLOONSHOW - Sent when the balloon is shown (balloons are quqeued). * NIN_BALLOONHIDE - Sent when the balloon disappears - when the icon is deleted, for example. This message is not sent if the balloon is dismissed because of a timeout or mouse click by the user. * NIN_BALLOONTIMEOUT - Sent when the balloon is dismissed because of a timeout. * NIN_BALLOONUSERCLICK - Sent when the balloon is dismissed because the user clicked the mouse." So on Win2000 no notification is sent and no ActionEvent is fired to the shared Java code.
12-08-2005