How to create two windows at the same time in JavaFX?

I tried this subwindow JavaFX 2.0 but the problem is that there is only one stage that can be redrawn (updated), and the other is only frozen, if you press any button at this stage, you will find that the button did not show "above" and "clicked" the image, how to solve it?

+6
source share
1 answer

Did you create a new milestone in the JavaFX Application Thread?

Try the following:

javafx.application.Platform.runLater(new Runnable() { @Override public void run() { Stage stage = new Stage(); stage.setScene(new Scene(new Group(new Button("my second window")))); stage.show(); } }); 

All operations with the FX interface must be performed in the JavaFX Application Theme section, see http://docs.oracle.com/javafx/2/architecture/jfxpub-architecture.htm#sthref8

+10
source

Source: https://habr.com/ru/post/915158/


All Articles