springboot-javafx-support icon indicating copy to clipboard operation
springboot-javafx-support copied to clipboard

Can't set controller in HelloworldJavaView demo

Open yrcs opened this issue 6 years ago • 3 comments

As the title say, there is the only one way to set the view's controller via "fx:controller" in fxml file and no way can set the controller via the pure java code.

yrcs avatar Dec 14 '18 05:12 yrcs

Found a solution?

co5dt avatar Feb 26 '19 12:02 co5dt

Found a solution? I am using mvvmfx, it can also work with Spring Boot. https://github.com/sialcasa/mvvmFX

yrcs avatar Mar 07 '19 12:03 yrcs

Since there was no answer for this for a long time: you can set either the controller or a controller factory in the FXMLLoader instance, but then you omit it in the .fxml file. As I saw, the controllerFactory is set in the view, so if you use this library, you don't have to set it in the .fxml

balazsvero avatar Mar 16 '23 11:03 balazsvero