-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
8u20
Created a simple JavaFX application with FXML in NetBeans and modified my start method to use a custom callback to provide the Controller class. Fields/Methods with @FXML are not being injected. Need a workaround, and a fix.
@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxmll = new FXMLLoader(null, null, null, (clazz) -> FXMLDocumentController.class);
Parent root = fxmll.load(getClass().getResourceAsStream("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
@Override
public void start(Stage stage) throws Exception {
FXMLLoader fxmll = new FXMLLoader(null, null, null, (clazz) -> FXMLDocumentController.class);
Parent root = fxmll.load(getClass().getResourceAsStream("FXMLDocument.fxml"));
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}