Applet runs but canvas is white.

If I run the same code as an application, then it the render display works fine.

I’ve instrumented my code with debug messages. and all the functions are called that need to be called.
The canvas flickers if I drag other widows over it (I see ‘tearing’), so I know something is being painted, but the canvas it is immediately repainted with solid white again.

  • Any ideas?

solved.

Within the Applet’s init() function getSize() was returning Dimension(0,0).
so the canvas was not visible.

public void init()
{
    GLCapabilities capabilities = new GLCapabilities();
    capabilities.setSampleBuffers(true);
    capabilities.setNumSamples(4);
    GLCanvas canvas = new GLCanvas(capabilities);
    canvas.addGLEventListener(new BoxShot());

canvas.setSize(getSize());
}