summaryrefslogtreecommitdiffstats
path: root/src/demos/applets/JOGLNewtApplet1Run.java
diff options
context:
space:
mode:
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);
}