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