I would like to block the owner window for a popup in JavaFX.
I initialize my popup like this:
popUp = new Popup();
popUp.getContent().add(content);
Thanks, optimal solution: example with FXML load file:
@Override
public void start(Stage primaryStage) throws IOException {
Parent root = FXMLLoader.load(getClass().getResource("DialogView.fxml"));
primaryStage.initModality(Modality.APPLICATION_MODAL); // 1 Add one
Scene scene = new Scene(root);
primaryStage.setScene(scene);
primaryStage.initOwner(primaryStage.getScene().getWindow());// 2 Add two
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}