Maybe try something like this in your JFrame constructor:
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addWindowListener( new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
//TODO: - Call your Exit Action Code from here
}
} );
( or else use your JFrame object to make these calls.... )