package GUI;
import java.awt.*;
import java.awt.event.*;


public class usingAWT extends Frame{

 

    public usingAWT(){

        super(\"프로그램 종료 이벤트\");

        this.setVisible(true);//화면에 보이도록 설정

        this.setSize(400, 550);//창 크기

        this.setLocation(200, 200);//창 배치 위치

        this.setResizable(false);//사이즈 조정 불가능 설정.

        this.addWindowListener(new WinEvent());// 윈도우 이벤트

    }

    public static void main(String[] args) {
     
     new usingAWT();

    }
   
    // 윈도우 이벤트 클래스

    class WinEvent implements WindowListener{


        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){}


    }


}



짤은없음