diff options
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/javax/media/opengl/GLJPanel.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java index be0b86121..192c5f1b1 100644 --- a/src/classes/javax/media/opengl/GLJPanel.java +++ b/src/classes/javax/media/opengl/GLJPanel.java @@ -42,6 +42,7 @@ package javax.media.opengl; import java.awt.*; import java.awt.geom.*; import java.awt.image.*; +import java.beans.*; import javax.swing.*; import java.nio.*; import java.security.*; @@ -716,6 +717,10 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { return joglContext; } else { if (!hardwareAccelerationDisabled) { + // Workaround for crashes in NetBeans GUI builder + if (pbuffer == null && Beans.isDesignTime()) { + return null; + } return pbuffer.getContext(); } else { return offscreenContext; @@ -737,6 +742,10 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { public void setAutoSwapBufferMode(boolean onOrOff) { if (!hardwareAccelerationDisabled) { + // Workaround for crashes in NetBeans GUI builder + if (pbuffer == null && Beans.isDesignTime()) { + return; + } pbuffer.setAutoSwapBufferMode(onOrOff); } else { drawableHelper.setAutoSwapBufferMode(onOrOff); |