the above code should be placed inside your reshape method so that you can draw a quad using the following at your intended location (placed inside your display method:

Quote

// Make sure you set a drawing state colour before you continue with the following code:gl.glBegin(GL.GL_QUADS); gl.glVertex2f(200.0f, 200.0f); gl.glVertex2f(400.0f, 200.0f); gl.glVertex2f(400.0f, 400.0f); gl.glVertex2f(200.0f, 400.0f);gl.glEnd();

Spend some time looking at the nehe demos as people have pointed towards above this post. Lots of good stuff to be learnt there. :D

Lots of methods have slightly different names to indicate what parameters they take. 3f for three floats for example. Usually for ones that take less parameters (like 2i) the third one just ends up defaulting to 0, which is just fine for most 2d stuff.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org