Question: 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?

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.

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.

Answer: 
You need to register an ApplicationListener:

There is a sample application available from Apple:

<http://developer.apple.com/library/mac/#samplecode/OSXAdapter/Introduction/Intro.html>
To not to break compatibility with Windows and other OSes here is approach with another approach:

<http://javadots.blogspot.com/2010/09/making-your-swing-app-macosx-compliant.html>

Maven dependency:

```
<dependency>
    <groupId>org.simplericity.macify</groupId>
    <artifactId>macify</artifactId>
    <version>1.6</version>
</dependency>

```