With your pretty minimal description, here is my solution.
Here is a tile-able representation. 1/2/3/4 represent "cases"

Assuming: i and j are dimensions of the chessboard, 50x50 is the size of a square.
Assuming: Constructor for GRect is (width, height, ipos, jpos), with top left rectangle coordinate system.
Assuming: Only making rectangles for black squares (cases 2 and 3)
Notice: cases 2 is when (i % 100 == 50) AND (
However, what you probably want is a checker board patter:
for (int i = 0; i < 400; i += 50) {
for (int j = 0; j < 400; j += 50) {
if (i % 100 == 0) {
if (j % 100 == 50) {//case 3
add(new GRect(50,50, i, j));
}
} else if (i % 100 == 50) {
if (j % 100 == 0) { //case 2
add (new GRect(50,50, i, j));
}
}
}
}
Note: no one has any idea what the constructor of GRect is, so i've made my best guess as to what to do.