title: Prevent JavaFX dialog from closing
body: <p>I'm currently creating a dialog using JavaFX. The Dialog it self works very well but now I'm trying to add an input validation which warns the user when he forgets to fill out a text field. 
  And here comes my question: Is it possible to prevent the dialog from closing inside the Result Converter? Like this:</p>
  
  <pre><code>ButtonType buttonTypeOk = new ButtonType("Okay", ButtonData.OK_DONE);
  dialog.getDialogPane().getButtonTypes().add(buttonTypeOk);
  
  dialog.setResultConverter((ButtonType param) -&gt; {   
  
      if (valid()) {
          return ...
      } else {
          Alert alert = new Alert(Alert.AlertType.WARNING);
          alert.setHeaderText("Pleas fill all fields!");
          alert.showAndWait();
          //prevent dialog from closing
      }
  
  });
  </code></pre>
  
  <p>I noticed that the dialog dosn't close if an error was thrown inside the resault converter but this doesn't seems to be a good way to solve this problem.</p>
  
  <p>If it isn't possible to solve the problem this way I could disable the button as described in <a href="https://stackoverflow.com/questions/28373232/how-to-reopen-prevent-closing-of-controlsfx-logindialog-on-failed-login">this post</a>. But I would prefer to keep the button enabled and display a message.</p>
  
  <p>Thank you in advance !</p>