question: private boolean requestSave ( ) { String msg = "Save edited domain file?" ; int n = JOptionPane . showConfirmDialog ( frame , msg ) ; if ( n == 0 ) { saveDomain ( ) ; return true ; } else if ( n == 1 ) { editorTab . rereadFile ( ) ; setSavedFlag ( true ) ; return true ; } return false ; }
target:  Asks the user whether to save the file. The method returns true if an action (save or discard changes) has been performed. Else (i.e. if the user has clicked cancel), return false.