private int showHasChangedDialog(){
  Object[] options={"Save","Don't Save","Cancel"};
  return JOptionPane.showOptionDialog(frame,"The workspace has changed since last save," + "\nWould you like to save these changes?","Workspace Has Changed",JOptionPane.YES_NO_OPTION,JOptionPane.WARNING_MESSAGE,null,options,options[0]);
}

private int showHasChangedDialog ( ) { Object [ ] options = { "Save" , "Don't Save" , "Cancel" } ; return JOptionPane . showOptionDialog ( frame , "The workspace has changed since last save," + "\nWould you like to save these changes?" , "Workspace Has Changed" , JOptionPane . YES_NO_OPTION , JOptionPane . WARNING_MESSAGE , null , options , options [ 0 ] ) ; }
checks to see if anything has changed and then offers to save if true .
