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.

4
  • Have you tried something like this ? Commented Mar 30, 2015 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 that shows the behavior you are describing? Commented Mar 30, 2015 at 14:53
  • Hi @James_D, This problem occurs when stage.setFullScreen (true);, Thanks. Commented Apr 9, 2015 at 15:39
  • alert.initModality(Modality.APPLICATION_MODAL); alert.initOwner(primaryStage); Commented Feb 7, 2017 at 7:56

1 Answer 1

2

Please set the owner of the alert box like below

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

Cheers

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.