nclass ImageCanvas extends Component
{
n
Image image;
n
ImageCanvas(Image image)
n
{this.image = image;}
n
public void paint(Graphics g)
n
{ g.drawImage(image, 0, 0, this);}
n}
Paint is called whenever a component must be shown,
the Graphics object does the actual drawing, it has to
be
passed in because it is what knows about physically
drawing on the screen