Login  Register

Re: Using NEWT the window flashes and then the program terminates.

Posted by Sven Gothel on May 22, 2012; 8:31pm
URL: https://forum.jogamp.org/Using-NEWT-the-window-flashes-and-then-the-program-terminates-tp4006834p4007420.html

On 05/22/2012 09:46 PM, petsagouris [via jogamp] wrote:

> The code is exactly the same as it is at the moment on the justincstuff site.
>
> Simple copy and paste, although it is not visible in the video since I used
> Ctrl+C/V for getting it rather than the context menus.
>
> The weird thing is that using the TestGearsNEWT.java
> <http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java;hb=HEAD> as
> referenced from the NEWT Overview
> <http://jogamp.org/jogl/doc/NEWT-Overview.html> page (adapting slightly the
> class layout to work standalone) makes everything tick. I don't know why the
> only new thing in that class is the usage of the Animator object...

Unlike AWT, creating a NEWT Window does not stop the JVM from being closed!

To do so, you either need to manually keep the main thread alive,
or - like many of the NEWT demos - keep another non daemon thread alive,
like the Animator.

~Sven