//file: ObserveImage.java
import java.awt.*;
public class ObserveImage extends java.applet.Applet {
Image img;
public void init( ) {
img = getImage( getClass( ).getResource(getParameter("img")) );
MyObserver mo = new MyObserver( );
img.getWidth( mo );
img.getHeight( mo );
prepareImage( img, mo );
}
public void paint(Graphics g) {
g.drawImage(img, 0, 0, null);
}
}
|