Yes, or in an arraylist.
Type: Posts; User: Norm
Yes, or in an arraylist.
There will need to be some way for the paintComponent() method to know if it is to draw a shape or not.
One way is to have a boolean that says so
Another way is to have the shapes in a list that...
That depends on how you code the paintComponent() method. A common way is to draw everything on every call
which means there is no erasing done. If you don't want to see a shape, don't draw it.
...
Put the code inside of an if statement that is true when you want it executed and false when you don't want it executed.