Each time paintComponent
is called, you are using what ever color was set last.
What you need to do is associate the color with the current activity, so that when paintComponent
is called, you can look up the color for the shape you are drawing.
You could create a custom class which contained the Line
and color values and add those to your List. When you paint the Line
, you would look up the color to use as well
You would need to do the same thing for your points