From 1ff81eb806d6df78994a808217eb2c5f6b4ef8da Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 14 Oct 2010 21:34:27 +0200
Subject: Fix/Syn with JOGL 774138544e1eec3330309ad682fa05154a07ab8d ; Notably
 add: Applet's with native NEWT support, ie jogl-newt-applet-runner-gears.html

---
 src/demos/swt/Snippet209.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'src/demos/swt/Snippet209.java')

diff --git a/src/demos/swt/Snippet209.java b/src/demos/swt/Snippet209.java
index 1deb1c4..30a1347 100644
--- a/src/demos/swt/Snippet209.java
+++ b/src/demos/swt/Snippet209.java
@@ -34,9 +34,6 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.glu.GLU;
 
 public class Snippet209 {
-  static {
-    GLProfile.initSingleton();
-  }
   static void drawTorus(GL2 gl, float r, float R, int nsides, int rings) {
     float ringDelta = 2.0f * (float) Math.PI / rings;
     float sideDelta = 2.0f * (float) Math.PI / nsides;
@@ -65,6 +62,13 @@ public class Snippet209 {
   }
 
   public static void main(String [] args) {
+    // set argument 'NotFirstUIActionOnProcess' in the JNLP's application-desc tag for example
+    // <application-desc main-class="demos.j2d.TextCube"/>
+    //   <argument>NotFirstUIActionOnProcess</argument> 
+    // </application-desc>
+    boolean firstUIActionOnProcess = 0==args.length || !args[0].equals("NotFirstUIActionOnProcess") ;
+    GLProfile.initSingleton(firstUIActionOnProcess);
+
     final GLProfile gl2Profile = GLProfile.get(GLProfile.GL2);
     final Display display = new Display();
     Shell shell = new Shell(display);
-- 
cgit v1.2.3