JDK-6268088 : PIT: Adding the same popup menu to 2 tray icons throws exception on Solaris but not on win32
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2005-05-10
  • Updated: 2011-01-19
  • Resolved: 2005-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
Description
I am adding 2 tray icons to system tray from a java application. One of the tray icons have a popup menu and other one does not have. Once they are added to the system tray, I am showing frame with a button. On clicking the button, I am adding the same popup menu to the other tray icon also. 

On Win32, both the tray icons show the popup menu properly when right clicking inside them. But on Sol10-JDS, an exception is thrown when right clicking inside one of the tray icons. 
Here is the exception:
java.lang.IllegalArgumentException: origin not in parent's hierarchy
at java.awt.PopupMenu.show(PopupMenu.java:142)
at sun.awt.X11.XTrayIconPeer.showPopupMenu(XTrayIconPeer.java:247)
at java.awt.TrayIcon.processMouseEvent(TrayIcon.java:628)
at java.awt.TrayIcon.processEvent(TrayIcon.java:610)
at java.awt.TrayIcon.dispatchEvent(TrayIcon.java:601)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:270)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:198)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:171)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:166)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:158)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:119)

This is noticed on the following PIT build:
java version "1.6.0-awt.pit-int-awt-blade"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-awt.pit-int-awt-blade-df153228_06_May_2005_08_56-b00)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b35, mixed mode)

The behavior on Win32 and SolarisSparc are expected to be compatible at application level. If there are any expected incompatibilities, it must be documented clearly.

I have attached the sample test. Execute the sample test on SparcSol10-JDS. You would see 2 tray icons in the notification area. Right click inside them. You will see a popup menu in one of the tray icons. Click the 'Toggle Popup' button on the frame. Now right click inside the icons. One of the icons would throw the above exception.
###@###.### 2005-05-10 18:11:15 GMT

Comments
EVALUATION When popup menu is set on the second tray icon its parent is changed. Trying to show the popup menu on the first tray icon leads to the exception mentioned in the description. We shouldn't allow to set the same popup menu on several tray icons. This requires javadoc change. ###@###.### 2005-05-14 12:40:18 GMT
14-05-2005