FileDocCategorySizeDatePackage
ImageView.javaAPI DocExample527Sat Sep 09 20:33:12 BST 2000None

ImageView.java

import java.applet.*;
import java.awt.*;
import java.net.*;

public class ImageView extends Applet {

  Image picture;

  public void init() {
  
    try {
      URL u = new URL(this.getCodeBase(), this.getParameter("IMAGE"));
      this.picture = this.getImage(u);
      System.err.println(u);
    }
    catch (MalformedURLException e) {
      // shouldn't happen, the code base is never malformed
    }
   
  }
  
  public void paint (Graphics g) {
    g.drawImage(this.picture, 0, 0, this);
  }

}