본문 바로가기

IT

WindowListener 이벤트 간단하게 처리하기

반응형
WindowListener windowListener = new WindowAdapter() {
    public void windowClosing(WindowEvent windowEvent) {
        System.out.println("Frame closed");
        windowEvent.getWindow().dispose();
    }
};

-----------
frame.addWindowListener(windowListener);
반응형