From 7207ecf94eae68ca65530450fc6711281e38b30a Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 19 Jun 2006 22:40:21 +0000 Subject: Added workarounds for exceptions being thrown in NetBeans GUI builder git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@818 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/javax/media/opengl/GLJPanel.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/classes/javax/media/opengl') 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); -- cgit v1.2.3