domingo, 26 de febrero de 2012

WindowEvent


package interfaces;

import java.awt.Frame;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

public class WindowEventTest2 implements WindowListener{


public static void main(String[] args) {
WindowEventTest2 w=new WindowEventTest2();
}

public WindowEventTest2(){
Frame f=new Frame();
f.setTitle("Window Event Test 2");
f.setSize(200, 150);
f.addWindowListener(this);
f.setVisible(true);
}

public void windowActivated(WindowEvent ev){}
public void windowClosed(WindowEvent ev){}
public void windowClosing(WindowEvent ev){System.exit(0);}
public void windowDeactivated(WindowEvent ev){}
public void windowDeiconified(WindowEvent ev){}
public void windowIconified(WindowEvent ev){}
public void windowOpened(WindowEvent ev){}

}

No hay comentarios:

Publicar un comentario