Duplicate :
|
|
Relates :
|
In Java 7 and 8, when you move a Java application to different monitor and add a Component to a Container on another graphics device, without explicitly removing the Component from its previous parent, the application crashes: java.lang.IllegalArgumentException: adding a container to a container on a different GraphicsDevice at java.awt.Component.checkGD(Unknown Source) at java.awt.Container.checkGD(Unknown Source) at java.awt.Container.checkGD(Unknown Source) at java.awt.Container.checkGD(Unknown Source) at java.awt.Container.addImpl(Unknown Source) at javax.swing.JTabbedPane.insertTab(Unknown Source) at javax.swing.JTabbedPane.addTab(Unknown Source) See this NetBeans issue for more details and sample code to reproduce: http://netbeans.org/bugzilla/show_bug.cgi?id=222051 A workaround is turning off Direct3D. This issue does not occur with Java 6.