To ensure that a Java GUI application exits properly when its main window is closed, simply use this statement