1: //IconDemo.java
2:
3: import javax.swing.ImageIcon;
4: import javax.swing.JApplet;
5: import javax.swing.JLabel;
6:
7: public class IconDemo extends JApplet
8: {
9: public void init()
10: {
11: JLabel niceLabel = new JLabel("Java is fun!");
12: ImageIcon dukeIcon = new ImageIcon("duke_waving.gif");
13: niceLabel.setIcon(dukeIcon);
14: getContentPane().add(niceLabel);
15: }
16: }