here is a program code i want to create an application that create frame and write the string on it and when i click the close tab of frame it will close the frame please help me...its very urgent..
import java.awt.event.*;
class SampleFrame
{
SampleFrame(String title)
{
super(title);
MyWindowAdapter adapter = new MyWindowAdapter(this);
addWindowListner(adapter);
}
public void paint(Graphics g)
{
g.drawString("This is in frame window", 10, 40);
}
}
class MyWindowAdapter extends WindowAdapter
{
SampleFrame sampleFrame;
public MyWindowAdapter(SampleFrame sampleFrame)
{
this.sampleFrame = sampleFrame;
}
public void windowClosing(WindowEvent we)
{
sampleFrame.show();
}
}
class AppletFrame
{
public static void main(String [] args)
{
SampleFrame s;
}
}