roskenet / springboot-javafx-support

SpringBoot / JavaFX8 Integration
MIT License
419 stars 140 forks source link

Initialize method never called without setting fx:controller in .fxml #66

Open mtbadi39 opened 6 years ago

mtbadi39 commented 6 years ago

Without setting fx:controller="someController" in the .fxml file, the initialize method never called ! So what the utility of the @FXMLController annotation.

roskenet commented 6 years ago

This is true. This annotation includes (as you see in the code) at the moment only the @Component annotation, to 'component scan' it as a Spring Bean. We "invented" this annotation to a) have a bit of semantic b) be safe in the future to add some fields there.

roskenet commented 6 years ago

Feel free to implement a convention for 'auto detecting' a controller from a bean. (In fact we haven't done this, because we could not agree on whether this should be called XYZController or XYZPresenter) ;-)