Applet: getImage(URL url, String name) : Applet « java.applet « Java by API






Applet: getImage(URL url, String name)

import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;

public class ImageApplet extends Applet {
  Image im;

  public void init() {
    im = getImage(getDocumentBase(), "image.jpg");
  }

  public void paint(Graphics g) {
    g.drawImage(im, 0, 0, this);
  }
}

           
       








Related examples in the same category

1.Applet: getDocumentBase()
2.Applet: newAudioClip(URL audioFileURL)