I am tasked with how to paint an arrayList of shapes in java.
I feel i have most of it right, there are two methods i am confused about however
the method in
super.paintComponent(g) invokes the paintComponent method from the superclass of JPanel (the JComponent class) to erase whatever is currently drawn on the panel. This is useful for animation, but not for setting color.
I guess you'll have to set the color of the shapes in your Arraylist
when you will create them, nonetheless it could be helpfull to see the Shape
class. Maybe you could create a function changeColor(Color ColorToBeSet)
in this shape class and loop through the shapes ArrayList to call it at the end of your ShapeListener