private boolean confirmOverwrites() {
    String filesToOverwrite = "";

    final File primaryFile = getPrimaryImageFile();
    if (primaryFile.exists()) {
      filesToOverwrite += primaryFile.getPath() + "\n";
    }

    final File secondaryFile = getSecondaryImageFile();
    if (secondaryFile.exists()) {
      filesToOverwrite += secondaryFile.getPath() + "\n";
    }

    final File combinedFile = getCombinedImageFile();
    if (combinedFile.exists()) {
      filesToOverwrite += combinedFile.getPath() + "\n";
    }

    if (!filesToOverwrite.equals("")) {
      return CMessageBox.showYesNoQuestion(
              this, String.format("%s\n These files already exist. Overwrite?", filesToOverwrite))
          == JOptionPane.YES_OPTION;
    }

    return true;
  }
Dialog to export the current view into a variety of formats.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/ExportViewDialog.java