title: JavaFX create alert and get result
body: <p>For my CS class they require us to use JavaFX alerts. I can make an alert appear, but how do I get what button was clicked? What would be the best way to go about getting this data?</p>
  
  <p>Also if possible, I'd like to make it have a drop down panel and when the user selects and option the alert closes and prints what the user selected.</p>
  
  <p>Here's some example code that I have. When I click one of the buttons, it just closes the dialog.</p>
  
  <pre class="lang-java prettyprint-override"><code>Alert a = new Alert(AlertType.NONE, "Promote pawn to:", new ButtonType("Queen"), new ButtonType("Rook"));
  a.setTitle("Title");
  a.setHeaderText("My header text");
  a.setResizable(true);
  a.setContentText("Content text");
  a.showAndWait();
  </code></pre>
  
  <p>Thanks,</p>