Sorry if this has been asked before.
I have a jframe with a textcomponent in it and a menu with an exit option. When you select the exit option a funciton is called that checks whether a change has been made to the document and the user can select to quit anyway or save changes etc.
What i need is to call the same function when the close button in the top right of the jframe is selected.
Any help would be appreciated, thanks.