public void reshape(GLAutoDrawable glDrawable, int x, int y, int width, int height) {
final GL gl = glDrawable.getGL();
final GLU glu = new GLU();
if(height <= 0)
height = 1;
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_PROJECTION); //Select the Projectionmatrix
gl.glLoadIdentity(); //Reset the current matrix
glu.gluPerspective(45.0f, width / height, 0.1f, 1000.0f); //set the Viewing Volume
gl.glMatrixMode(GL.GL_MODELVIEW); //select The Modelview Matrix
gl.glLoadIdentity(); //set the ModelView matrix to identity
}