Program "crashes" when I setResizable(true) and resize the Window

I’m unable to reproduce this with Windows11. There is some lag of the rectangle when the window is resized but it always comes back to the window width and height. Naive question: Why don’t you just make the window background white (and forget the rectangle)?

I just noticed that your movie was made with an additional line of code where you println() the frameCount; what happens when you take that line out? I tried adding that line to the Windows11 code and it still works as expected.