Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Clearing a section of a panel

+10 votes
Is there a way to clear just a certain section of a drawing panel?
asked Feb 1, 2016 in (Winter 15-16) by Michael McAleer (100 points)

1 Answer

+4 votes
Best answer
Well, you can use g.fillRect(...) with the color white (assuming white is your background color).

In most cases, it's easier to just clear the whole panel, then re-draw everything you want seen, and then do panel.sleep for a bit.  (Yes, there's still some flicker, but c'est la vie.)
answered Feb 2, 2016 by Forrest Stonedahl (100 points)
selected Feb 2, 2016 by Michael McAleer