Since there is certainly more than one way for your program to exit, maybe you
should separate the logic of you ExitAction class to another method and/or
class. Then your ExitAction consists merely of a method call. The
windowlistener can then call that same method in response to a window closing
event. I am unsure how one would fire an event themselves so that ExitAction
could catch it. Perhaps someone else knows how to do this?