title: Can Not update scene from another controller in javafx
body: <p>I'm new to <code>Javafx</code>, I have a <code>menuBar</code> and multiple scenes that I can switch between them using the <code>MenuBar</code>, all worked fine until I tried to do something when clicking the menu item other than showing the scene.</p>
  
  <p>I'm trying to show some writing in the textfield <code>nom</code> by using the method <code>reload();</code> of the scene that I'm trying to show, I call the <code>Enfantcontroller</code> from my <code>homeController</code> class where I have the menu items action methods and I call the <code>reload()</code> to write the text to the textfield in <code>enfantView</code> method when I click the menu item  but nothing happens after I load the controller for that scene. here's my code:</p>
  
  <p><strong>EnfantController class</strong></p>
  
  <pre><code>    public class EnfantController implements Initializable {  
  
          @FXML
          private TextField nom;
  
  
          /**
           * Initializes the controller class.
           */
          @Override
          public void initialize(URL url, ResourceBundle rb) {
              // TODO
  
          }
          public void reload() {
                 this.nom.setText("vndghj");    
          }
  
  }
  </code></pre>
  
  <p><strong>homeController class</strong></p>
  
  <pre><code>public class CrechHomeController implements Initializable {
  
      /**
       * Initializes the controller class.
       */
      @FXML
      private BorderPane borderPane;
  
      private AnchorPane enfant;
  
      @Override
      public void initialize(URL url, ResourceBundle rb) {
          try {
              // TODO
              enfant = FXMLLoader.load(getClass().getResource(("/Views/Enfant.fxml")));
  
  
          } catch (IOException ex) {
              Logger.getLogger(CrechHomeController.class.getName()).log(Level.SEVERE, null, ex);
          }
  
      }
  
      @FXML
      public void enfantItemAction() throws IOException {
          // getting the controller class and execute the reload method
  
          FXMLLoader loader = new FXMLLoader();
          loader.setLocation(getClass().getResource("/Views/Enfant.fxml"));
          loader.load();
  
          EnfantController enfantController = loader.getController();
          enfantController.reload();
          borderPane.setCenter(enfant);
  
      }
  }
  </code></pre>
  
  <p>I know I might be overlooking something here, but I can't figure out what it is, help will be appreciated.</p>