如何在Java Swing中捕获关闭事件

问题描述:

我想捕获窗口关闭(红色X右上角位置)事件.我想根据事件在该窗口上显示一个指定的窗口.

I want to capture window close(red X right top position) event. I want to display a specified window upon that window based on the event.

您需要实现WindowListener接口,或注册WindowAdapter.

You need to either implement the WindowListener interface, or register a WindowAdapter.