canvas.setVSync(false);
// canvas.addWindowListener(WindowListener.EXIT_ON_CLOSE);
canvas.addWindowListener(new WindowListener() {
public void windowActivated() {}
public void windowClosing() {canvas.dispose(); System.exit(0); }
public void windowClosed() {}
public void windowDeactivated() {}
public void windowDeiconified() {}
public void windowIconified() {}
});