import java.awt.Frame;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
// 2. 상속
class InterWindowEx extends Frame implements WindowListener
{
public InterWindowEx()
{
setSize( 200, 300 );
setVisible( true );
addWindowListener( this ); // 감지기 메소드
}
public void windowActivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
public void windowClosing(WindowEvent e)
{
System.exit( 0 ); // 닫으라는 명령
}
public void windowDeactivated(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowOpened(WindowEvent e) {}
public static void main(String[] args)
{
new InterWindowEx();
/*
// 1. 객체 생성
Frame f = new Frame();
f.setSize( 200, 300 );
f.setVisible( true );
*/
}
}
'매니저 > JAVA1' 카테고리의 다른 글
JAVA1 InnerWindow 예제 (임시저장) (0) | 2011.12.23 |
---|---|
JAVA1 Inner Class, Local, Static, Anonymous 예제 (임시저장) (0) | 2011.12.23 |
JAVA1 interface 예제3 (임시저장) (0) | 2011.12.23 |
JAVA1 interface 예제2 (임시저장) (0) | 2011.12.23 |
JAVA1 interface 예제1 (임시저장) (0) | 2011.12.23 |