title: How can i make JavaFX Confirmation dialog without cancel button?
body: <p>I just want to make javaFX Confirmation dialog without cancel button.</p>
  
  <p>When i just made dialog without cancel button, "X" button to close the dialog does not work.
  How can i make without "Cancel" button?</p>
  
  <pre><code>Alert alert = new Alert(AlertType.CONFIRMATION);
  alert.setTitle("Confirmation Dialog with Custom Actions");
  alert.setHeaderText("Look, a Confirmation Dialog with Custom Actions");
  alert.setContentText("Choose your option.");
  
  ButtonType buttonTypeOne = new ButtonType("One");
  ButtonType buttonTypeTwo = new ButtonType("Two");
  ButtonType buttonTypeThree = new ButtonType("Three");
  ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE);
  
  alert.getButtonTypes().setAll(buttonTypeOne, buttonTypeTwo, buttonTypeThree, buttonTypeCancel);
  
  Optional&lt;ButtonType&gt; result = alert.showAndWait();
  if (result.get() == buttonTypeOne){
      // ... user chose "One"
  } else if (result.get() == buttonTypeTwo) {
      // ... user chose "Two"
  } else if (result.get() == buttonTypeThree) {
      // ... user chose "Three"
  } else {
      // ... user chose CANCEL or closed the dialog
  }
  </code></pre>
  
  <p>In this code i want to remove</p>
  
  <pre><code>ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE);
  </code></pre>
  
  <p>to make user can choose one of "One, Two, Three" without cancel button but the "X" button to work well.</p>
  
  <p>I just tried like this.</p>
  
  <pre><code>Alert alert = new Alert(AlertType.CONFIRMATION);
  alert.setTitle("Confirmation Dialog with Custom Actions");
  alert.setHeaderText("Look, a Confirmation Dialog with Custom Actions");
  alert.setContentText("Choose your option.");
  
  ButtonType buttonTypeOne = new ButtonType("One");
  ButtonType buttonTypeTwo = new ButtonType("Two");
  ButtonType buttonTypeThree = new ButtonType("Three");
  
  
  alert.getButtonTypes().setAll(buttonTypeOne, buttonTypeTwo, buttonTypeThree);
  
  Optional&lt;ButtonType&gt; result = alert.showAndWait();
  if (result.get() == buttonTypeOne){
      // ... user chose "One"
  } else if (result.get() == buttonTypeTwo) {
      // ... user chose "Two"
  } else if (result.get() == buttonTypeThree) {
      // ... user chose "Three"
  } else {
      // ... user chose CANCEL or closed the dialog
  }
  </code></pre>
  
  <p>But when i made like this, the "X" button does not work. How can i handle this?</p>