public void setCheckBox(final String checkBoxText) {
    checkBox.setText(checkBoxText);
    checkBox.setBorder(new EmptyBorder(0, 0, 0, 0));

    final String approve = getApproveButtonText();
    final JButton approveButton =
        (JButton)
            GuiHelper.findComponentByPredicate(
                this,
                c -> {
                  if (!(c instanceof JButton)) {
                    return false;
                  }

                  final String text = ((JButton) c).getText();
                  if (text == null) {
                    return approve == null;
                  }
                  if (approve == null) {
                    return false;
                  }
                  return ((JButton) c).getText().equals(approve);
                });

    JComponent parent = null;
    if (approveButton != null) {
      final Container approveParent = approveButton.getParent();
      if (approveParent instanceof JComponent) {
        parent = (JComponent) approveParent;
      }
    }

    if (parent == null) {
      // Fallback to using setAccessory() (ugly, but at least it works)
      setAccessory(checkBox);
      return;
    }

    // OS X is using SpringLayout, so we can just add the component and
    // are done.
    if (SystemHelpers.isRunningMacOSX()) {
      parent.add(checkBox, 0);
      return;
    }

    // Move the original buttons to a separate button panel while keeping
    // the original layout manager
    final JPanel buttonPanel = new JPanel(parent.getLayout());
    for (final Component c : parent.getComponents()) {
      buttonPanel.add(c);
    }

    // Set a new layout and add our checkbox
    parent.setLayout(new BorderLayout(0, 0));
    parent.add(checkBox, BorderLayout.LINE_START);
    parent.add(buttonPanel, BorderLayout.CENTER);
  }
Whether to ask for an existing file to be overwritten. Only makes sense in dialogs of type
<code>JFileChooser.SAVE_DIALOG</code> or <code>JFileChooser.CUSTOM_DIALOG</code>.

@see JFileChooser#setDialogType(int)
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/CFileChooser.java