A few things that come to mind regarding to usage of constructor invocation. You should load the FXML file yourself, parse it and construct the node graph defined in it, then, do the following steps :
- the
@FXML
annotated fields must be bound between node graph and controller class
- the eventHandlers in controller must be attached to the right nodes where defined in FXML
- calling the constructor's
initialize()
method in right place in right time
- and much more staff that
FXMLLoader
do while it is load()
ing ...
Those staffs can be explored in FXMLLoader's source code.
Having said that, you can still invoke constructor yourself but set it to FXMLLoader before calling FXMLLoader's load methods as:
TestController mc = new TestController();
FXMLLoader loader = new FXMLLoader();
loader.setController(mc);
loader.load();
This way all above mentioned "dirty works" will be handled by FXMLLoader, then "Don't worry, be happy" :).