void () { MyController controller = new MyController(); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("injectedController.fxml")); fxmlLoader.setRoot(this); fxmlLoader.setController(controller); try { fxmlLoader.load(); } catch (IOException exception) { throw new RuntimeException(exception); } }