package gldemo; import java.awt.Frame; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLProfile; import javax.media.opengl.awt.GLCanvas; public class Main { public static void main(String[] args) { GLProfile.initSingleton(true); GLProfile glp = GLProfile.getDefault(); GLCapabilities caps = new GLCapabilities(glp); GLCanvas canvas = new GLCanvas(caps); // Frame frame = new Frame(); frame.setSize(320, 240); frame.setVisible(true); frame.add(canvas); // crash } }