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

Multiple window problems

Open z357904947 opened this issue 5 years ago • 2 comments

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

z357904947 avatar May 03 '19 12:05 z357904947

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?

XHXJ avatar Sep 27 '19 04:09 XHXJ

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.

balazsvero avatar Mar 16 '23 11:03 balazsvero