I am using Graphics.drawString() and Graphics2D.drawString() but I would
like to change the default behaviour of not clearing the background as it
displays each character of the text. Is it possible to change it somehow so
that the background behind each character is cleared as it is displayed? I
seem to remember this was possible but I cannot see how to do it.
Thanks,
Wes
Oliver Wong - 26 May 2006 19:06 GMT
>I am using Graphics.drawString() and Graphics2D.drawString() but I would
>like to change the default behaviour of not clearing the background as it
>displays each character of the text. Is it possible to change it somehow
>so that the background behind each character is cleared as it is displayed?
>I seem to remember this was possible but I cannot see how to do it.
By "clearing the background", perhaps you mean "fill a rectangle behind
the string with a uniform colour"? If so, try the fillRect() method. There's
also a clearRect() method if you want the uniform colour to be the
background colour.
- Oliver