This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
hi all, when i look at the API doc, i found Graphics has two method: fillRect(), clearRect(). fillRect() use current Color and clearRect() use backgroundColor, i can use setColor() set current Color, how can i set backgroundColor? where is the backgroundColor? thanks
Michael, I found this in the Java 2 specs: public abstract void clearRect(int x, int y, int width, int height) Clears the specified rectangle by filling it with the background color of the current drawing surface. This operation does not use the current paint mode. Beginning with Java 1.1, the background color of offscreen images may be system dependent. Applications should use setColor followed by fillRect to ensure that an offscreen image is cleared to a specific color. Hope this helps. Stephanie
Joined: Jul 30, 2000
Stephanie, thanks a lot is that means background color depend on system, you can not set? and what is the current paint mode, that means paint()? thanks michael