Animator Exception in JPanel

When I add an animator to a GLCanvas embedded in a Frame or JFrame it works fine. When I add the animator to a GLCanvas in a JPanel I get the following exception:


net.java.games.jogl.GLException: Surface already unlocked
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.unlockSurface(WindowsOnscreenGLContext.java:192)
      at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.free(WindowsOnscreenGLContext.java:134)
      at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:203)
      at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:182)
      at net.java.games.jogl.GLCanvas.display(GLCanvas.java:82)
      at net.java.games.jogl.Animator$1.run(Animator.java:104)
      at java.lang.Thread.run(Unknown Source)

Any ideas as to what this means and how I can overcome this problem?

You GLCanvas must be visible on screen before you start the animator.

Cool, thanks! :smiley: