A couple of times now, I have had this problem. After having drawn something in a component, for instance by g.drawLine(…) or similar, I want to erase it again. Say the line I draw has moved, and I need to draw it somewhere else - how do I “erase” the old one?
Painting over the entire component only works, if the component is opaque - say I have a completely transparent component, except the line I am drawing… How would I go about erasing the “former” line? Obviously, it doesn’t work to draw the line with a transparent Colour… Any thought?