// ImageLoad.java /* <applet code="ImageLoad.class" width=1000 height =800> </applet> */ import java.applet.Applet; import java.awt.*; public class ImageLoad extends Applet { Image image; public void init(){ image = getImage(getDocumentBase(), "aiboakira.jpg"); } public void paint(Graphics g){ g.drawImage(image, 0, 0, this); } }ImageLoad.classをappletとして取り込む htmlファイルは次のようになる.
<html> <head><title>ImageLoad Applet</title> <applet code="ImageLoad.class" width=1000 height =800> </applet> <hr> <A HREF="ImageLoad.java">source</a> </body> </html>