title: JavaFX 2.0 + FXML. Updating scene values from a different Task
body: <p>I want to get the controller from a scene that i've loaded with FXMLoader. The use case is:</p>
  
  <ol>
  <li>My JSON manager receives a JSON object</li>
  <li><p>The task I've launched shows a new Scene using</p>
  
  <pre><code>Parent p = FXMLLoader.load(getClass().getResource("foo.fxml"));
  Scene scene = new Scene(p);
  stage.setScene(scene);
  </code></pre>
  
  <p>After that, i have the empty scene.</p></li>
  <li><p>Now I do this to fill the components</p>
  
  <pre><code>AnchorPane pane = (AnchorPane)((AnchorPane) scene.getRoot()).getChildren().get(0);
  for(Node node : pane.getChildren()){
      String id = node.getId();
      if(id.equals(NAME)){
           ((TextField)node).setText(value);
      }
  }
  </code></pre></li>
  </ol>
  
  <p>My question, is there an easier way to do this? I have a controller specified in FXML</p>
  
  <pre><code>&lt;AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="526.0" minWidth="356.0" prefHeight="526.0" prefWidth="356.0" 
  xmlns:fx="http://javafx.com/fxml" fx:controller="bar.foo"&gt;
  </code></pre>
  
  <p>I want to get the instance with the bind values (TextField called name in this case)</p>
  
  <p>Thanks in advance</p>