title: JavaFX 2.2 Modal window dialog *with* FXML
body: <p>I am trying to use the example provided by @jewelsea <a href="https://gist.github.com/1887631" rel="nofollow noreferrer">at this gist</a> and I'm stuck because I'm using FXML.</p>
  
  <p>I have seen both of these posts: <a href="https://stackoverflow.com/questions/10486731/how-to-create-a-modal-window-in-javafx-2-1">How to create a modal window in JavaFX 2.1</a> and <a href="https://stackoverflow.com/a/10494886/492404">this answer to JavaFX 2 modal window</a>.</p>
  
  <p>Where I'm stuck is in the code by jewelsea, where it says:</p>
  
  <pre><code>final WebView webView = new WebView(); 
  webView.getEngine().load("http://docs.oracle.com/javafx/");
  primaryStage.setScene(new Scene(webView));
  </code></pre>
  
  <p>Whereas, since I'm using FXML, I do this:</p>
  
  <pre><code>FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MyFXML.fxml"));
  Scene scene = (Scene)fxmlLoader.load();
  myController = fxmlLoader.getController();
  primaryStage.setScene(scene);
  </code></pre>
  
  <p>Can you tell me how to modify my code (the 4 lines above), so it works with jewelsea's example?</p>
  
  <p>Thanks!</p>