1
2import java.awt.Graphics;
3import java.awt.Image;
4
5import javax.swing.JApplet;
6
7public
8class ImageTest extends JApplet {
9
10 Image image;
11
12 public
13 void init() {
14 image = getImage(getDocumentBase(),
15 getParameter("image"));
16 }
17
18 public
19 void destroy() {
20 if ( image != null )
21 image.flush();
22 }
23
24 public
25 void paint(Graphics g) {
26 g.drawImage(image,0,0,this);
27 }
28
29 public
30 void update(Graphics g) {
31 paint(g);
32 }
33}