roskenet / springboot-javafx-support

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

Multiple window problems #86

Open z357904947 opened 5 years ago

z357904947 commented 5 years ago

When multiple windows are opened, the listen event in the previous window is invalid.

XHXJ commented 5 years ago

I have the same problem.

launch(Application.class, MainStageView.class, args);
Main.showView(ListStageView.class, Modality.NONE);
Stage stage = GUIState.getStage();
stage.widthProperty().addListener((observable, oldValue, newValue) -> System.out.println(newValue));

How to get the monitor of the ListStageView after it displays?

balazsvero commented 1 year ago

This got not answered for a long time. I ran into similar issues while trying to create my own integration and finally realized that since Spring beans are singletons by default, you must specify them as scope = prototype to create a new instance of the controller every time a component is being created. This was not considered in any of the springboot - javafx integrations I had evaluated.