BowlCanvas.java
import java.awt.*;

/**
 * Title: BowlCanvas<p>
 * Description: A single bowl element in the game board for 
 * Pancet, a game applet.  The game board consists of four
 * bowls, two belong to the computer and two to the player.<p>
 *
 * Copyright: Copyright (c) 2004<p>
 *
 * @author Mark Bondurant
 * @version 3.0
 */

class BowlCanvas extends Canvas {
    private String label;
    private int labelX, labelY;
    private Image bowlImage;

    BowlCanvas(String id, Image b, int x, int y) {
        setBackground(Color.white);
        label = id;
        labelX = x;
        labelY = y;
        bowlImage = b;
    }

    public void paint(Graphics g) {
        g.drawImage(bowlImage, 10, 10, this);
        g.drawString(label, labelX, labelY);
    }

    public void update(Graphics g) {
        g.drawImage(bowlImage, 10, 10, this);
        g.drawString(label, labelX, labelY);
    }

    void setImage(Image b) {
        bowlImage = b;
        repaint();
    }
}


BowlCanvas.java