ALT key causes an error

I got a small Jogl application running with a GLCanvas inside an AWT Frame and some Swing components sitting next to the GLCanvas (no overlapping). There’s an Animator class, some java.util.TimerTask classes, etc. The key event listener I registered to the GLCanvas.

Everything works fine. Until you press the ALT key (the left or right one; doesn’t matter). Then the following error stack is being reported:

java.lang.NullPointerException
at javax.swing.SwingUtilities.getWindowAncestor(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsRootPaneUI$AltProcessor.postProcessKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Unfortunately I’m no Java/Swing expert (let alone Jogl/OpenGL :slight_smile: so don’t have any idea what I am doing wrong.

What could I do in order to find the error/bug/… ?

So actually all your ALT keys do work pretty well when key-listened to an AWT GlCanvas, and the above error just pops up on my silly Win2000 box.
Sigh.

Btw it’s the international version of the JRE 1.4.2_X used within Europe, so maybe there’s some difference in keyboard handling…?