9.1.7 Checkerboard V2 Answers _best_

If the user resizes the window, you want the board to redraw. Override the init() method to add a resize listener or simply set the canvas size to be fixed using setSize(400, 400) in the constructor.

If your squares alternate in a row but look like stripes vertically, you likely forgot to include the row index in your parity check (you might only be checking col % 2 ). 9.1.7 checkerboard v2 answers

for row from 0 to 7: for col from 0 to 7: x = col * squareSize y = row * squareSize if (row + col) % 2 == 0: color = RED else: color = BLACK draw a square at (x, y) of size squareSize with fill color If the user resizes the window, you want the board to redraw