United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6303746 PIT: ActionEvent is not at all triggered when clicking TrayIcon message on Win2000
6303746 : PIT: ActionEvent is not at all triggered when clicking TrayIcon message on Win2000

Details
Type:
Bug
Submit Date:
2005-07-29
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2005-08-16
Component:
client-libs
OS:
windows_2000
Sub-Component:
java.awt
CPU:
x86
Priority:
P3
Resolution:
Not an Issue
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:
Relates:
Relates:

Sub Tasks

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.
                                     
2005-08-16
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.
                                     
2005-08-12



Hardware and Software, Engineered to Work Together