Hello,
my gljpanel isn’t rendered when I want to remove it, it is not associated with an Animator, and juste before removing it, I wrote
gljPanel.setVisible(false);
gljPanel.setEnabled(false);
I tried to use Ken’s method, but I don’t know exactly how to do.
I added (before calling panelA.removeAll()):
final GLJPanel gljPanel = panelD.getGLJPanel();
gljPanel.setVisible(false);
gljPanel.setEnabled(false);
Runnable supprimerGLJPanel = new Runnable() {
public void run() {
remove(gljPanel);
}
};
SwingUtilities.invokeAndWait(supprimerGLJPanel);
and then, when I call panelA.removeAll, I have the following errors :
Exception in thread “Thread-11” javax.media.opengl.GLException: Error releasing pbuffer device context: error code 0
at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.destroy(WindowsPbufferGLDrawable.java:92)
at com.sun.opengl.impl.GLPbufferImpl.destroy(GLPbufferImpl.java:176)
at javax.media.opengl.GLJPanel.removeNotify(GLJPanel.java:408)
at java.awt.Container.removeNotify(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeNotify(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeNotify(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeNotify(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeNotify(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeNotify(Unknown Source)
at javax.swing.JComponent.removeNotify(Unknown Source)
at java.awt.Container.removeAll(Unknown Source)
Is it the good way to use SwingUtilities? I don’t understand why I have problems for removing the gljPanel if I put it to : setVisible(false)…