user2056929
user2056929

Reputation: 1

how to make sure that before repaint () cleared all the contents of the Jframe?

how to make sure that before repaint () cleared all the contents of the Jframe? doing something like a stopwatch just turns out that the figures on top of one another are drawn


Upvotes: 0

Views: 32

Answers (1)

Cedric Mamo
Cedric Mamo

Reputation: 1744

If I'm understanding your question well, what you need to do is draw a rectangle with the background color as big as the area you want. That effectively "clears" the area and you can draw on a clean "canvas" again

Upvotes: 1

Related Questions