United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8003398 : IllegalArgumentException: adding a container to a container on a different GraphicsDevice

Details
Type:
Bug
Submit Date:
2012-11-14
Status:
Closed
Updated Date:
2017-05-22
Project Name:
JDK
Resolved Date:
2017-05-22
Component:
security-libs
OS:
linux
Sub-Component:
CPU:
Priority:
P3
Resolution:
Duplicate
Affected Versions:
7,8,9
Fixed Versions:
10

Related Reports
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
This is a bug in java 1.7 and happens when you add a Component to a Container on another graphics device, without explicitly removing the Component from its previous parent.

See this NetBeans issue for more details and sample code to reproduce: http://netbeans.org/bugzilla/show_bug.cgi?id=222051
                                    

Comments
Reopen it. Customer provided requested info
                                     
2017-05-03
trace files
                                     
2017-05-02
already addressed by JDK-8160696 in 9. JDK-8160696 is back-ported to 8 in 8u152 and to 7 in 7u131.
                                     
2017-05-01
 - this is an issue reported against 7(7u),
 - there are now affected version 9 filed for this issue
 - 7u issues are transferred to Sustaining
Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9
or
7u specific escalations might be reopen to Sustaining
                                     
2014-08-10
 - this is an issue reported against 7(7u),
 - there are now affected version 9 filed for this issue
 - 7u issues are transferred to Sustaining
Nevertheless if someone have a report against 9 - please reopen and add affectedVersion 9
or
7u specific escalations might be reopen to Sustaining
                                     
2014-08-10
These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. 
Kind regards,
Mathias
                                     
2013-08-29
These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. 
Kind regards,
Mathias
                                     
2013-08-29
These are all approved for deferral to JDK 9 so you can update the FixVersion to state JDK 9. 
Kind regards,
Mathias
                                     
2013-08-29
*This is anti-deferral criteria list*:
    - P2
-------------- Engineering's Criteria -------------------------------------
    - tck-red labeled
    - conformance labeled
    - P3 regressions reported/labeled against jdk8
    - findbugs, parfait, eht labeled bugs
    - CAP <1 year reported
    - netbeans  <1 year reported 

Victor
----------------- SQE's OK ---------------------------------
Yes, we are ok with that

thanks, Mikhail

                                     
2013-08-15
Converted "8-client-defer-candidate" label to "8-defer-request" by SQE' OK.
                                     
2013-08-15
8-defer-request:

This is the issue reproduced from 7 GA, this is not a regression in 8, requesting to defer because there are no customer escalations on this issue. 
                                     
2013-06-17
Bug reproduced since jdk 7 FCS
                                     
2012-11-21
> I am not sure what should be in stringID. Reassigning to 2D team. 

Its a different string that's all that matters.


The root cause of this is the AWT fix in JDK 7 b55 fix in early 2009 for :-
https://jbs.oracle.com/bugs/browse/JDK-6804747
"Ensure consistent graphicsConfig member across components hierarchy

FWIW the netbeans test case assumes Xinerama but I was able to modify the program
to get the exception on Solaris 10 SPARC in non-xinerama mode .. 


                                     
2012-11-19
Please provide the stack trace.
                                     
2012-11-15
I am not sure what should be in stringID. Reassigning to 2D team.

JDK-7124231 was closed as a not reproducible issue.

I have found the next workaround
http://orangepalantir.org/topicspace/index.php?idnum=55

may be a problem here is similar to this issue
JDK-4733263
                                     
2012-11-15
There's sample code attached to NetBeans bug that reproduces the problem - it isn't that hard to run that code...

Here's the stack trace anyway:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: adding a container to a container on a different GraphicsDevice
	at java.awt.Component.checkGD(Component.java:1178)
	at java.awt.Container.addImpl(Container.java:1086)
	at java.awt.Container.add(Container.java:998)
	at javax.swing.JFrame.addImpl(JFrame.java:562)
	at java.awt.Container.add(Container.java:966)
	at javaapplication19.TestCanvas$2.actionPerformed(TestCanvas.java:41)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.Component.processMouseEvent(Component.java:6505)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
	at java.awt.Component.processEvent(Component.java:6270)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:682)
	at java.awt.EventQueue$3.run(EventQueue.java:680)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:696)
	at java.awt.EventQueue$4.run(EventQueue.java:694)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

                                     
2012-11-15



Hardware and Software, Engineered to Work Together