title: Migrate from Javafx2.2 to Javafx8
body: <p>I am trying to migrate Javafx2.2 application to Javafx8. I am getting following issue while using nested <code>FXML</code>:</p>
  
  <pre><code>javafx.fxml.LoadException: Root hasn't been set.
  Use method setRoot() before load.
  </code></pre>
  
  <p>FXML file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;fx:root type="javafx.scene.layout.VBox" 
           xmlns:fx="http://javafx.com/fxml"
           xmlns="http://javafx.com/javafx/8"
           fx:controller="com.ui.TestController"&gt;
      &lt;TextField fx:id="textField"/&gt;
      &lt;Button text="Click Me"/&gt;
  &lt;/fx:root&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre class="lang-java prettyprint-override"><code>FXMLLoader loader = new FXMLLoader();
  loader.setResources(bundle);
  InputStream in = Main.class.getClassLoader().getResourceAsStream(fxml);
  loader.setBuilderFactory(new JavaFXBuilderFactory());
  loader.setLocation(Main.class.getResource(fxml));
  Node page = null;
  try {
      page = (Node) loader.load(in);
  } catch (IOException e) {
      logger.error("{}", e);
  } finally {
      try {
          in.close();
      } catch (IOException e) {
          logger.error("{}", e);
      }
  }
  </code></pre>
  
  <p>I need <code>page</code> node to set in another <code>BorderPane.center</code>. It works with Javafx2.2. What I am missing here? Any help would be appreciated.</p>