How to style JavaFX 2 Fullscreen message?

2019-04-20 06:56发布

问题:

Going to Fullscreen mode in JavaFX causes a giant message telling the user that he can leave this mode pressing ESC. Not only this takes the "desktopish" feeling off my application, it also looks ugly.

I guess this message is not ment to be suppressed, so my hope is that i can at least brand it. So, how can i style it?

回答1:

There is a requests to Allow trusted apps to disable the fullscreen overlay warning and disable the "Exit on ESC" behavior and Touch Screen only - Press ESC to exit full-screen mode. does not apply. Neither request has been implemented as of JavaFX 2.2.

There are no requests to allow the message to be styled that I could find. You could create one under the JavaFX Runtime project, but I think it would be rejected due to potential security concerns.



回答2:

JavaFX 8 has a way to suppress this message:

stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);


回答3:

You can just completely disable the message with:

primaryStage.setFullScreenExitHint("");


标签: javafx-2