I have a frame, and want to prompt when the user closes it to save the document. But if they cancel, the frame shouldn\'t close.
frame.addWindowListener(new
Closing an Application might make the process a little easier for you.