In JavaFX, the FXMLLoader
automatically creates the specified controller in an .fxml file using 0-arg constructor. It also provides methods to set/create the controller manually using FXMLLoader#setController
or FXMLoader#setControllerFactory
.
My question now is what is the difference between them? Are there situation where one is better than the other?
The documentation of both methods don’t really answer my question.