imagePne.java

phantasia4/phantasia/src/118_client/imagePne.java · 494 B

From the archive phantasia4.tar.gz

Download the archive   « Back to the archive contents

import java.awt.*;

public class imagePne extends Canvas implements constants {

    pClient parent = null;
    int imageNumber = -1;

    public imagePne(pClient c) {

	super();
	parent = c;
	setBackground(highlightColor);
    }

    public void paint(Graphics g) {

	if (imageNumber != -1 && parent.theImages[imageNumber] != null) {
	    g.drawImage(parent.theImages[imageNumber], 0, 0, this);
	}
    }

    public void setImage(int newImage) {

	imageNumber = newImage;
	repaint();
    }
}

Site Stats

Snippets: 1791
Codebases: 571