title: How to detect the JFrame is closed?
body: <p>I tried a <code>addWindowListener</code> and implement the <code>windowClosing</code>, it works, when I press the close button, but when I use <code>Cmd+Q</code> to close, the <code>windowClosing</code> is not being called, how can I solve it? Do I need to detect <code>Cmd+Q</code> on mac, <code>Alt + F4</code> on windows via key listener? Is that a general listener for closing window, whatever via the close button or keyboard, or event <code>Ctrl+Alt+Delete</code> or <code>Cmd+Option+Esc</code> to focus kill? Thanks.</p>