Login  Register

Re: NullPointerException when GLWindow.setVisible(true) is called?

Posted by Xerxes Rånby on Feb 07, 2014; 1:59pm
URL: https://forum.jogamp.org/NullPointerException-when-GLWindow-setVisible-true-is-called-tp4031493p4031494.html

2014-02-07 13:39, Pepe1 [via jogamp] skrev:

> I'm using this code to init a GLWindow:
>
>         private void initGLWindow()
>         {
>                 glWindow = GLWindow.create(caps);
>                 glWindow.setTitle(name);
>                 glWindow.setSize(sizeX, sizeY);
>                 glWindow.setAutoSwapBufferMode(true);
>                 glWindow.addGLEventListener(this);
>                 glWindow.setVisible(true);
>         }
>
> Pretty straightforward stuff, however when setVisible(true) is called, it suddenly throws a NullPointerException. Why does this happen? All the other calls succeeded, so it's weird that only that last call yields an exception, right?
>
> Thanks for the help!

We require some additional information, please read:
http://jogamp.org/wiki/index.php/Jogl_FAQ#Bugreports_.26_Testing

Also the complete sourcecode for your example would be needed since we do not know which caps you use and on which hardware + driver combination you test on.
Please include the stacktrace for the nullpointer exception, since we cant possibly guess.

Cheers
Xerxes