
4.4 Using Color 193
by simply changing the values of sX and sY. We don’t need to change any of
the arguments sent to the Graphics methods. To demonstrate this, try
changing the values of sX and sY and re-running the applet.
4.4 Using Color
All the figures we have drawn were black. That’s because when our applet
starts, the default drawing color is black. We can add color to the drawing by
setting the current color, also called the foreground color, which is part of
the graphics context represented by the Graphics object sent to the paint
method. The draw and fill methods draw the figures in the current color.
The current color remains in effect until ...