1. Don't call repaint() either of the same component or another in its UI hierearchy from within a painting method override.
2. Don't compare a boolean variable to a boolean literal.
3. Learn and follow the
Java coding conventions in respect of vertical and horizontal whitespace and placement of braces.
4. Don't write multiple statements on one line.
Also, detecting a mousePressed (or released) is usually more reliable than detecting mouseClicked, which is only triggered when the press and release are within a system-defined radius (sometimes 0). And do you have a reason for attempting to fill a rectangle
30000 pixels square? which you can't of course as the Graphics' clip will be much smaller than that.