O'Reilly logo
  • Michael ss thinks this is interesting:

If you click the close icon in the upper-right corner of the window, the window would normally disappear from the screen, but your application might not necessarily close. To close the application via the click of the window’s close icon, you need to process window events.

From

Cover of Java Programming

Note

windoweventlistener 可用来关闭窗口,上个程序点close不一定关了窗口。