title: Java Swing - On a Mac, listening for Quit event
body: <p>In a Java application on a Mac, you can click the top bar and select Quit to exit the program. How can I add a listener to my JFrame to listen to this?</p>
  
  <p>I did a search on this and found ApplicationListener, however Eclipse puts a "cross out" in this and seems to think its deprecated or something.</p>
  
  <p>Specifically, I found to use com.apple.eawt.ApplicationListener, but how do I do this? Do I need to download this com.apple.eawt package? I can't seem to find it.</p>