-
Bug
-
Resolution: Unresolved
-
P4
-
jfx13
-
x86_64
-
windows_10
A DESCRIPTION OF THE PROBLEM :
I met following scenario:
1ï¼Stage A is set as "setAlwaysOnTop(true)".
2) Stage B pops an Alert to have user select some buttons.
3) Stage A is on top and covering buttons of the Alert.
Then app is blocking: Stage A can not get focus before user click buttons on Alert but Alert is unavaliable before stage A is moved away from top of it.
This happens due to Alert's not bring itself to front. When it stays under others, problem happens.
I found following solution:
https://stackoverflow.com/questions/38799220/javafx-how-to-bring-dialog-alert-to-the-front-of-the-screen?r=SearchResults
And solved this problem by adding following lines for all alerts in my app:
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.setAlwaysOnTop(true);
stage.toFront();
But I do not think this is the right way to avoid this problem. Maybe Alert need always bring itself to top automatically to avoid blocking whole application.
I met following scenario:
1ï¼Stage A is set as "setAlwaysOnTop(true)".
2) Stage B pops an Alert to have user select some buttons.
3) Stage A is on top and covering buttons of the Alert.
Then app is blocking: Stage A can not get focus before user click buttons on Alert but Alert is unavaliable before stage A is moved away from top of it.
This happens due to Alert's not bring itself to front. When it stays under others, problem happens.
I found following solution:
https://stackoverflow.com/questions/38799220/javafx-how-to-bring-dialog-alert-to-the-front-of-the-screen?r=SearchResults
And solved this problem by adding following lines for all alerts in my app:
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.setAlwaysOnTop(true);
stage.toFront();
But I do not think this is the right way to avoid this problem. Maybe Alert need always bring itself to top automatically to avoid blocking whole application.
- relates to
-
JDK-8306079 Stage.setAlwaysOnTop(true) fails.
-
- Closed
-