NOTE: Standalone application has void main( ) but Applet swing doesnot consist it.
PROGRAM:
~~~~~~~~~~
import javax.swing.*;
public class A extends JApplet
{
public static void main(String args[])
{
JLabel jl=new JLabel("MY FIRST SWING APPLICATION");
JFrame jf=new JFrame("SWING FRAME");
jf.setSize(500,500);
jf.setVisible(true);
jf.add(jl);
}
}
OUTPUT:
PROGRAM:
~~~~~~~~~~
import javax.swing.*;
public class A extends JApplet
{
public static void main(String args[])
{
JLabel jl=new JLabel("MY FIRST SWING APPLICATION");
JFrame jf=new JFrame("SWING FRAME");
jf.setSize(500,500);
jf.setVisible(true);
jf.add(jl);
}
}
OUTPUT:
No comments:
Post a Comment