FileDocCategorySizeDatePackage
showImage.javaAPI DocExample653Thu Apr 03 15:20:06 BST 1997None

showImage.java

import java.awt.*;
import java.applet.*;
import java.awt.image.*;

public class showImage extends Applet {

  Image thePicture;
  
  public void init() {

    thePicture = getImage(getDocumentBase(), "logo.gif");
  
  }
  
  
  public void paint(Graphics g) {
   
     if(!g.drawImage(thePicture, 0, 0, this)) {
       g.drawString("Loading Picture. Please hang on", 25, 50);
     }
     
  }
  
 public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
    if ((infoflags & ImageObserver.ALLBITS) == ImageObserver.ALLBITS) {
      repaint();
      return false;
    }
    else {
      return true;
    }
  
  } 
  
}