summaryrefslogtreecommitdiffstats
path: root/src/demos/applets/JOGLNewtApplet1Run.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-09-14 11:45:30 -0700
committerSven Gothel <[email protected]>2009-09-14 11:45:30 -0700
commit0afab6a652471cf1c140d3affe6ae442ab217ff1 (patch)
treeb515e3913c878ccb07c4c246be06c51b91200469 /src/demos/applets/JOGLNewtApplet1Run.java
parente7003e596519e225ecec5b4423314c4dcaa05db8 (diff)
Fixes and tested JOGLNewtApplet1Run/JOGLNewtAppletBase
Diffstat (limited to 'src/demos/applets/JOGLNewtApplet1Run.java')
-rwxr-xr-xsrc/demos/applets/JOGLNewtApplet1Run.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/demos/applets/JOGLNewtApplet1Run.java b/src/demos/applets/JOGLNewtApplet1Run.java
index 08522de..6ea3251 100755
--- a/src/demos/applets/JOGLNewtApplet1Run.java
+++ b/src/demos/applets/JOGLNewtApplet1Run.java
@@ -2,6 +2,9 @@ package demos.applets;
import java.applet.*;
import java.awt.Container;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.KeyListener;
import javax.media.opengl.*;
import javax.media.nativewindow.*;
@@ -60,6 +63,19 @@ public class JOGLNewtApplet1Run extends Applet {
if(null!=nWindow) {
base.init(nWindow);
}
+ if(base.isValid()) {
+ GLEventListener glEventListener = base.getGLEventListener();
+
+ if(glEventListener instanceof MouseListener) {
+ addMouseListener((MouseListener)glEventListener);
+ }
+ if(glEventListener instanceof MouseMotionListener) {
+ addMouseMotionListener((MouseMotionListener)glEventListener);
+ }
+ if(glEventListener instanceof KeyListener) {
+ addKeyListener((KeyListener)glEventListener);
+ }
+ }
} catch (Throwable t) {
throw new RuntimeException(t);
}