appletSize = this.getSize(); // get the dimensions of this applet
xCoord = 0; // start in the top left corner
yCoord = 0;
yCount = 1;
// loop over the applet height
do
{
if (yCount % 2 == 0)
{
xCount = 1;
}
else
{
xCount = 0;
}
xCoord = 0;
// loop over the applet width
do
{
if (xCount % 2 == 0)
{
g.setColor(Color.white);
}
else
{
g.setColor(Color.black);
}
g.fillRect(xCoord, yCoord, width, height);
xCoord = xCoord + width;
xCount = xCount + 1;
} while (xCoord < appletSize.width);
yCount = yCount + 1;
yCoord = yCoord + height;
} while (yCoord < appletSize.height);