WindowAdapter class in java
//WindowsAdapter class
import java.awt.*;
import java.awt.event.*;
class MyFrame3 extends Frame
{
MyFrame3(String title)
{
super(title);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
System.exit(0);
}
});
}
public static void main(String[] args) {
MyFrame3 obj = new MyFrame3("My Frame3");
obj.setSize(300, 300);
obj.setVisible(true);
}
}
OUTPUT:
Comments
Post a Comment