JavaFX + FXML integration with Spring
Question
I want to integrate javaFX with Spring IOC. For that I have found some valuable tutorial on steveonjava.com.
Can any one please tell me with that "ScreensConfiguration" (as display on below) class, how I am going to load some Controller with FXML.
That means currently "ScreensConfiguration" class only load FXML + DialogBox related (depended) UIs know. I want to load some Controller UI with this manner.
Thanks a lot.
@Configuration
@Lazy
public class ScreensConfiguration {
private Stage primaryStage;
public void setPrimaryStage(Stage primaryStage) {
this.primaryStage = primaryStage;
}
public void showScreen(Parent screen) {
primaryStage.setScene(new Scene(screen, 800, 500));
primaryStage.show();
}
@Bean
CustomerDataScreen customerDataScreen() {
return new CustomerDataScreen(customerDataScreenController());
}
@Bean
CustomerDataScreenController customerDataScreenController() {
return new CustomerDataScreenController(model, this);
}
@Bean
@Scope("prototype")
AutowireFXMLDialog errorDialog() {
return new AutowireFXMLDialog(getClass().getResource("Error.fxml"), primaryStage, StageStyle.UNDECORATED);
}
@Bean
@Scope("prototype")
AutowireFXMLDialog addUserDialog() {
return new AutowireFXMLDialog(getClass().getResource("AddUser.fxml"), primaryStage);
}
@Bean
@Scope("prototype")
AutowireFXMLDialog loginDialog() {
return new AutowireFXMLDialog(getClass().getResource("Login.fxml"), primaryStage, StageStyle.UNDECORATED);
}
}
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow