import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class TestFrameEvent extends Frame implements WindowListener
{
	TestFrameEvent()
	{
     		super("New Frame");
     		setSize(300,200);
     		setVisible(true);
     		addWindowListener(this);
        }
   	public void windowClosing(WindowEvent e)
        {
		System.out.println("Windows is closing");
           	dispose();
           	System.exit(0);
        }
	public void windowClosed(WindowEvent e)
        {
		System.out.println("Windows closed");
           
        }
	public void windowOpened(WindowEvent e)
        {
		System.out.println("Window Opened");
           
        }
	public void windowIconified(WindowEvent e)
        {
		System.out.println("Windows iconized");
        }
	public void windowDeiconified(WindowEvent e)
        {
		System.out.println("Windows deiconized");
        }
	public void windowActivated(WindowEvent e)
        {
		System.out.println("Windows Activated");
        }
	public void windowDeactivated(WindowEvent e)
        {
		System.out.println("Windows Deactivated");
       	}
	public static void main(String args[])
	{
		TestFrameEvent tf=new TestFrameEvent();
	}
}

Click here to go back.

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus


Footer1