opengl – glOrthof is not applied

I had a problem with OpenGL where glOrthof was not applied, which gave my frame the default ratio of 1: 1: 1. Here is the code setting it up:

                public vacuum reshape (GLAutoDrawable glAutoDrawable, int i, int i1, int i2, int i3) {
GL2 gl = glAutoDrawable.getGL (). GetGL2 ();
if (window.getWidth ()! = screenWidth || window.getHeight ()! = screenHeight) window.setSize (screenWidth, screenHeight);
unitsTall = window.getHeight () / (window.getWidth () / unitsTall);
gl.glMatrixMode (GL2.GL_PROJECTION);
gl.glLoadIdentity ();
gl.glOrthof (0.0f, unitsWide, 0.0f, unitsTall, 0.0f, 1.0f);
gl.glMatrixMode (GL2.GL_MODELVIEW);
}

unitsWide equals 100. Here's the code to draw the rectangle:

                public static void drawRect (float x, float y, float width, float height) {
GL2 gl = Render.getGL2 ();
gl.glRotatef (-rotation, 0,0,1); // the rotation had to be reversed
gl.glColor4f (red, green, blue, alpha);
gl.glBegin (GL2.GL_QUADS);
gl.glVertex2f (x, y);
gl.glVertex2f (x + width, y);
gl.glVertex2f (x + width, y + height);
gl.glVertex2f (x, y + height);
gl.glEnd ();
gl.glFlush ();
gl.glRotatef (rotation, 0,0,1);
}

The class "Render" is the class with all the main methods for OpenGL. Here is the code I used to draw the rectangle:

Graphics.drawRect (0,0,0.5f, 1);

Finally, here's a screenshot of what it looks like when this code is executed:

Picture of the game window, the lower left corner of the rectangle is (0,0)

I looked around and I did not find any other problem like this. Please tell me what I could do wrong.