Create an image alongwith string with Java Applet

import java.awt.*;
import javax.swing.*;
/*
    <applet code="label" width=300 height =100>
    </appelet>
*/
public class label extends JApplet
{
    public void init()
    {
        Container contentPane=getContentPane();
        ImageIcon i=new ImageIcon("Spain.gif");
        JLabel j1=new JLabel("Spain",i,JLabel.CENTER);
        contentPane.add(j1);
    }
}



 

Top