Hello guys,

I am completely new in Java and I have to create a class draws a filled rectangle on screen
I should create an applet that creates 16 instances of the class that draws the filled rectangle and show them in an applet in a 4x4 grid.
I already have the class and have created two instances of the object (just for testing), the problem I have is that I am getting the first box in the position I want (x=4, y=5, w=50, h=50) but the second instance is shown at the bottom end of the frist box, I mean that the boxes are shown in diagonal and it doesn't displays next the first box, something like this:

twoBoxes.jpg

Does anybody could give me any advice on how I could create this grid?

Thank you all