The variable remembers, the canvas forgets
There’s one decision in the click protocol program worth a moment of thought. Each run of mouseClicked starts by repainting the background, exactly like the crosshairs did, so the circle of the previous click is erased and only the newest circle is visible. And yet the protocol at the top still lists every click since the program started.
The two behaviors don’t contradict each other. Whatever you draw on the canvas is just paint: repaint the background and it’s gone. The protocol survives because it isn’t stored on the canvas at all. It’s stored in the variable clickPositions, and it’s drawn onto the canvas again, freshly and completely, after every click.
Drawing something is not the same as remembering it. Variables remember, and the canvas only shows.