1

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.

Marco R
  • 306
  • 2
  • 11
  • Have you tried something like [this](http://stackoverflow.com/questions/14168064/how-to-create-a-javafx-dialog) ? – Stefan Mar 30 '15 at 14:44
  • 1
    I don't see this behavior; it simply shows the Alert in front of the existing window. Can you create a simple [MCVE](http://stackoverflow.com/help/mcve) that shows the behavior you are describing? – James_D Mar 30 '15 at 14:53
  • Hi @James_D, This problem occurs when stage.setFullScreen (true);, Thanks. – Marco R Apr 09 '15 at 15:39
  • alert.initModality(Modality.APPLICATION_MODAL); alert.initOwner(primaryStage); – Kundan Ray Feb 07 '17 at 07:56

1 Answers1

2

Please set the owner of the alert box like below

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

Cheers

Kundan Ray
  • 370
  • 1
  • 4
  • 15