animator.stop(); System.exit(0);
new Thread(new Runnable() { public void run() { animator.stop(); System.exit(0); } }).start();
  public void run(String[] args) {    canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());    canvas.addGLEventListener(new Listener());    animator = new Animator(canvas);    frame = new Frame();    frame.setLayout(new BorderLayout());    canvas.setSize(512, 512);    frame.add(canvas, BorderLayout.CENTER);    frame.pack();    frame.show();    canvas.requestFocus();    frame.addWindowListener(new WindowAdapter() {        public void windowClosing(WindowEvent e) {          animator.stop();          System.exit(0);        }      });    animator.start();  }