title: alert type none closing javafx
body: <p>I have a program with a menu bar that have an 'About' button to display some info about the app.</p>
  
  <p>The thing is that when I use AlertType.INFORMATION I can hit Ok button to close the alert, but when i use NONE when i hit the close window button, nothing happens. I already tried to put a setOnCloseAction(e-> close()); but it dont close either.</p>
  
  <p>Thanks!</p>
  
  <pre><code>public class RootLayoutController {
  
  private MainApp main;
  
  @FXML
  private MenuItem loadFiles;
  
  @FXML
  private MenuItem about;
  
  @FXML
  private void displayAbout() {
      Alert alert = new Alert(AlertType.NONE);
      alert.initStyle(StageStyle.UTILITY);
      alert.initOwner(main.getPrimaryStage());
      alert.setTitle("Organiz3r");
      alert.setHeaderText("Organiz3r v1.0");
      alert.setContentText("Developed at BitBucket");
      alert.showAndWait();
  }
  
  @FXML
  private void handleLoad() {
      FileChooser fileChooser = new FileChooser();
      fileChooser.setTitle("Open Files");
      List&lt;File&gt; files = fileChooser.showOpenMultipleDialog(main.getPrimaryStage());
      main.loadFiles(files);
  }
  
  public RootLayoutController() {
      // TODO Auto-generated constructor stub
  }
  
  public void setMain(MainApp main) {
      this.main = main;
  }
  </code></pre>
  
  <p>Main is setted at main class with </p>
  
  <pre><code>// Load root layout from fxml file.
          FXMLLoader loader = new FXMLLoader();
          loader.setLocation(MainApp.class.getResource("view/RootLayout.fxml"));
          rootLayout = (BorderPane) loader.load();
  
          RootLayoutController controller = loader.getController();
          controller.setMain(this);
  </code></pre>