![]() |
The Java Developers Almanac 1.4 |
|
e557. Loading and Drawing an Image in an AppletSee also e551 The Quintessential Applet. Image image;
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);
}
© 2002 Addison-Wesley. |