Create a simple swing frame
import javax.swing.*;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class ws extends JFrame
{
Container c;
public ws(String title)
{
super("Frame");
c=this.getContentPane();
c.setBackground(Color.pink);
setSize(300,400);
addWindowListener(new f1());
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
show();
}
class f1 extends WindowAdapter
{
public void windowClosed(WindowEvent e)
{
System.exit(0);
}
}
public static void main(String args[])
{
ws w=new ws("frame 1");
}
}