Source of DukeApplet.java


  1: 
  2: import javax.swing.*;
  3: import java.awt.*;
  4: 
  5: public class DukeApplet extends JApplet
  6: {
  7:     public void init( )
  8:     {
  9:         Container contentPane = getContentPane( );
 10:         contentPane.setLayout(new BorderLayout( ));
 11: 
 12:         JLabel spacer = new JLabel("             ");
 13:         contentPane.add(spacer, "West");
 14:         JLabel niceLabel = new JLabel("Java is fun!");
 15:         ImageIcon dukeIcon = new ImageIcon("duke_waving.gif");
 16:         niceLabel.setIcon(dukeIcon);
 17:         contentPane.add(niceLabel, BorderLayout.CENTER);
 18:     }
 19: }