Java examples for Applet:Applet Creation
Loading and Drawing an Image in an Applet
import java.applet.Applet; import java.awt.Graphics; import java.awt.Image; class BasicApplet extends Applet { Image image;/*from w w w . ja va2 s . c o m*/ public void init() { // Load image image = getImage(getDocumentBase(), "http://hostname/image.gif"); } public void paint(Graphics g) { // Draw image g.drawImage(image, 0, 0, this); } }