title: Java alternative to @FXML injection of controllers?
body: <p>So I have a master controller from the main fxml file and two other controllers from the includes files. Now I inject the child controllers via <code>@FXML ChildController childController</code>. Now it works and everyone who worked with FXML before knows what im talking about. The dependency injection with annotation is all fine but I want to do this myself because I have my own plans on handling all DIs.</p>
  
  <p>(Question below)</p>
  
  <p>This is how I initiate the entire thing:</p>
  
  <pre><code>public void start(Stage primaryStage) throws Exception {    
      FXMLLoader loader = new FXMLLoader();
      loader.setLocation(getClass().getResource("Some resource"));
  
      MainController mainController = new Controller();
      loader.setController(mainController);
  
      Scene scene = new Scene(loader.load(), w, h);
  
      primaryStage.setScene(scene);
  
      primaryStage.show();
  }
  </code></pre>
  
  <p>Basically I want to do this: </p>
  
  <pre><code>SubController1 A = new SubController1();
  SubController2 B = new SubController2();
  MainController C = new MainControllerC(A, B);
  </code></pre>
  
  <p>So how can I do this with FXML (JavaFX)?</p>