I have been working on this part of code for a day and just can't figure out why it always generates error.
I have a controller and FXML. They worked perfectly. Then it came to my mind that I want to reuse this particular controller with a abstract updateSelect() function. Therefore, I change the controller to abstract.
The code compiled just fine. Until I try to run this part of code.
@FXML
private void mnuProjMember_onClick(ActionEvent event) {
mainContent.getChildren().clear();
FXMLLoader loader = new FXMLLoader(getClass().getResource("PaneProjectSearch.fxml"));
PaneProjectSearchController controller = new PaneProjectSearchController(){
@Override
void updateSelect(){
System.out.println("update: !!");
}
};
loader.setController(controller);
controller.setParent(mainContent);
fitToParent(loader);
}
It gives me following error message. Well...it's non-sense because the code will work fine again after I remove the abstract parts without even touching the FXML or other functions.
Error resolving onAction='#btnAdd_onClick', either the event handler is not in the Namespace or there is an error in the script. file:/D:/NetBeansWork/ProjCostTracking/dist/run1210215635/ProjCostTracking.jar!/ProjCostTracking/PaneProjectSearch.fxml:20
Any guidance and advise is welcomed, thanks :)