
import javax.swing.JApplet;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import java.awt.Container;
import java.awt.BorderLayout;
import java.awt.Color;

public class IconApplet extends JApplet
{
    public void init( )
    {
        Container contentPane = getContentPane( );
        contentPane.setBackground(Color.YELLOW);
        contentPane.setLayout(new BorderLayout( ));

        JLabel shift = new JLabel("             ");
        JLabel aLabel = new JLabel("Welcome to my applet.");
        ImageIcon dukeIcon = new ImageIcon("duke_waving.gif");
        aLabel.setIcon(dukeIcon);
        contentPane.add(shift, BorderLayout.WEST);
        contentPane.add(aLabel, BorderLayout.CENTER);
    }
}
