Exception when using multiple screens

I open the application on the main screen. I externalize a dockable and put this dockable on the second screen. Next, I externalize a second dockable which results in the following exception:

Thrown: java.lang.IllegalArgumentException: adding a container to a container on a different GraphicsDevice
java.awt.Component.checkGD(Unknown Source)
java.awt.Container.checkGD(Unknown Source)
java.awt.Container.checkGD(Unknown Source)
java.awt.Container.checkGD(Unknown Source)
java.awt.Container.checkGD(Unknown Source)
java.awt.Container.checkGD(Unknown Source)
java.awt.Container.checkGD(Unknown Source)
java.awt.Container.addImpl(Unknown Source)
java.awt.Container.add(Unknown Source)
bibliothek.gui.dock.station.screen.ScreenDockDialog.setDisplayer(ScreenDockDialog.java:274)
bibliothek.gui.dock.ScreenDockStation.combine(ScreenDockStation.java:683)
bibliothek.gui.dock.ScreenDockStation.drop(ScreenDockStation.java:630)
bibliothek.gui.dock.facile.action.StateManager.externalize(StateManager.java:861)
bibliothek.gui.dock.facile.action.StateManager.change(StateManager.java:628)
bibliothek.gui.dock.facile.action.StateManager.change(StateManager.java:604)
bibliothek.gui.dock.facile.action.StateManager.transition(StateManager.java:527)
bibliothek.gui.dock.support.action.ModeTransitionManager.goIn(ModeTransitionManager.java:402)
bibliothek.gui.dock.support.action.ModeTransitionManager$Mode$1.action(ModeTransitionManager.java:655)
bibliothek.gui.dock.themes.basic.action.BasicButtonHandler.triggered(BasicButtonHandler.java:48)
bibliothek.gui.dock.themes.basic.action.BasicButtonModel.trigger(BasicButtonModel.java:425)
bibliothek.gui.dock.themes.basic.action.BasicButtonModel$Listener.mouseReleased(BasicButtonModel.java:458)
java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

You are making a joke, surely you must have invented this error…

… isn’t AWT/Swing supposed to help developers with that kind of stuff? :twisted:

No, I’m not joking :wink:

I think part of the problem lies in Java3D. When you construct a Canvas3D you need to give it a java.awt.GraphicsConfiguration. That GraphicsConfiguration is then e.g. of the main screen. I solved part of the problem.

It should be tested with e.g. the paint example, which has just swing components. I can not test it at the moment because I don’t have a second screen at home ;-(

I’ll let you know the outcome.

Thanks, that spares me from searching a second monitor…

I tested the paint example (with setExternalizable( true ); ) on multiple screens.

It works correctly !!!

So, the problems I have are totally related with Java3D and NOT with DockingFrames.

Good news, isn’t it :wink:

Hehe, it’s always good to blame others :smiley:

Is there a way to change the graphics-device of Java3D? It should easy to detect (and handle?) the event when the parent changes.