@Override
    public boolean contains(int x, int y) {
// If the button has changed size, 
        // make a new shape object.
        if (shape == null
                || !shape.getBounds().equals(getBounds())) {
            shape = new Ellipse2D.Float(0, 0,
                    getWidth(), getHeight());
        }
        return shape.contains(x, y);
    }