Why does the setColor
of a Graphics
object reset when I use the repaint
method?
views:
87answers:
3
A:
I am guessing you are overriding paint(Graphics)
(or possibly update
), and not always setting the colour in there. Component
sets the colour (and font) of the Graphics
object from its own settings. The Graphics
object you receive is unlikely to be the same one from one paint to another.
Tom Hawtin - tackline
2009-09-20 19:46:37
A:
It is possible you draw an image. If so: after drawing your image the color sets default back to Color.BLACK
Martijn Courteaux
2009-09-21 09:53:08