rect.setColor(Color.WHITE);
The canvas is 400×400, but squares don't align perfectly. Fix: Calculate the window size dynamically from the square size and number of squares, as shown in the constants above. 9.1.6 checkerboard v1 codehs
: Ensure your loops run from 0 to 7 (less than 8 ). The canvas is 400×400