I want to force an Alert to be on top of other applications. Alerts seems to be lacking a setAlwaysOnTop function.
I have seen this post: JavaFX 2.2 Stage always on top.
I have tried:
- create a new stage and stage.setAlwaysOnTop(true), then alert.initOwner(stage).
- create a new stage and stage.initModality(Modality.APPLICATION_MODAL), then alert.initOwner(stage).
Does anyone know how to achieve this?
Edit: I am using Java 8.
Let say I have safari opened, and it is being focused. I want to bring the Alert to the top of the screen, in front of safari, when I call its showAndWait() function.