Why call the windowClosing method? That is normally done by the jvm in response to a user action.
Is the button supposed to close the window in the same way as a click on the window's system menu...