@Override
    public void actionPerformed(final ActionEvent event) {
      if (event.getSource() == workspaceDirectoryPanel.getButton()) {
        final DirectoryChooser selector = new DirectoryChooser("Select workspace location");
        selector.setSelectedFile(new File(workspaceDirectoryPanel.getText()));

        if (selector.showOpenDialog(NewWorkspaceDialog.this) == DirectoryChooser.APPROVE_OPTION) {
          final File workspaceDir = selector.getSelectedFile();

          if (workspaceDir.exists()) {
            workspaceDirectoryPanel.setText(selector.getSelectedFile().getAbsolutePath());
          } else {
            CMessageBox.showError(
                selector, "Workspace directory does not exist. Please choose a valid one.");
          }
        }

        return;
      } else if (event.getSource() == ok) {
        if (!validateValues()) {
          return;
        }

        okPressed = true;
      }

      dispose();
    }
Dialog for creating new BinDiff workspaces.
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/NewWorkspaceDialog.java