package com.jogamp.opengl.test.bugs; import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; import javax.media.opengl.GLProfile; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.util.Animator; public final class BugNEWTDisplaySetTitle { @Test public void testException() { final GLProfile profile = GLProfile.get(GLProfile.GL3); final GLCapabilities caps = new GLCapabilities(profile); final GLWindow window = GLWindow.create(caps); window.setSize(640, 480); final Animator anim = new Animator(); anim.setUpdateFPSFrames(60, System.err); anim.add(window); window.addGLEventListener(new GLEventListener() { @Override public void init( final GLAutoDrawable drawable) { // Nothing } @Override public void dispose( final GLAutoDrawable drawable) { // Nothing. } @Override public void display( final GLAutoDrawable drawable) { window.setTitle(String.format( "%f fps", anim.getLastFPS())); } @Override public void reshape( final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { // Nothing } }); window.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE); window.setVisible(true); anim.start(); } }