title: JavaFX Dialogbox communication
body: <p>I am new to JavaFX and trying to create an Confirmation Dialogbox.
  I know already that there is no real build in dialogbox in JavaFX so I created one myself like this:</p>
  
  <pre><code>@FXML
  public void delBox() {
       try {
          Stage dialogStage = new Stage();
          AnchorPane root = FXMLLoader.load(getClass().getResource("Dialog.fxml"));
          Scene scene = new Scene(root);
          dialogStage.setScene(scene);
          dialogStage.showAndWait();
      } catch(Exception e) {
          e.printStackTrace();
      } 
  }
  </code></pre>
  
  <p>It looks pretty good already, but what I dont understand is, how those two Stages can communicate with each other? I want to pass a String to the dialog which is than shown in the message, also when one of the buttons in the dialog window is clicked I wanna react to this in the accordingly.</p>
  
  <p><strong>Can anyone explain me how communication between the stages works?</strong>
  btw: I use <code>.FXML</code> files and controller classes.</p>