Friday, 14 June 2013

program in java - window adapter


import java.awt.*;
import java.awt.event.*;

class a4 extends Frame
{
    public static void main(String args[])
    {
        a4 a=new a4();

        a.setTitle("Myframe");
        a.setSize(500,500);
        a.setVisible(true);
        a.addWindowListener(new myclass());
    }
}
class myclass extends WindowAdapter
{
    public void windowClosing(WindowEvent we)
    {
        System.exit(0);
    }
}

No comments: