简体   繁体   中英

Show Alert JavaFX

When the alert is opened, this minimized the main window, displays the alert, when I close the alert, returns to the main window. It is possible that the alert is displayed above the main window ?? Thanks.

Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Information Dialog");
alert.setTitle("Information Dialog");
alert.setHeaderText("Look, an Information Dialog");


alert.show();

Thanks.

Please set the owner of the alert box like below

alert.initModality(Modality.APPLICATION_MODAL);
alert.initOwner(primaryStage);

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM