This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 127728 [details] Contains a simple Netbeans module illustrating the problem in Netbeans, as well as a simple java class that illustrates this using awt/swing code only. On a dual screen setup, an IllegalArgumentException can be thrown in Netbeans during following scenario when using jre 1.7 (any version) - undock a window and move it to the other screen - dock the window --> IllegalArgumentException: adding a container to a container on a different GraphicsDevice 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. I've attached a simple Netbeans module that illustrates the problem. When ran, you can create a Canvas by going to Windows -> Canvas. Undocking this Canvas, moving to another screen, and re-docking illustrates the bug. I've also attached a simple java class that illustrates this is a jre 1.7 bug. Workaround: Call component.getParent().remove(component) before calling container.add(component). This issue does not occur when using java 1.6.
Thanks for the detailed steps to reproduce. Please provide also your JDK version number so that I can file the bug to JDK team.
Reproduced on: java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode) And on: java version "1.7.0_10-ea" Java(TM) SE Runtime Environment (build 1.7.0_10-ea-b15) Java HotSpot(TM) Server VM (build 23.6-b04, mixed mode) Thanks for looking into this.