private File getImageFile(final String fileName) {
    String path =
        destinationChooserPanel
            .getText()
            .replace('\\', File.separatorChar)
            .replace('/', File.separatorChar);
    if (!path.endsWith(File.separator)) {
      path += File.separator;
    }

    final String[] fileExtensions = {".png", ".jpeg", ".gif", ".svg"};
    path += fileName + fileExtensions[imageFormat.getSelectedIndex()];

    return new File(path);
  }
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