Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change scene when in fullscreen in JavaFX and avoid "Press ESC to exit fullscreen" message

How is it possible to change scene of fullscreen window and avoid to show "Press ESC to exit fullscreen" message?

I'm building fullscreen desktop application (touchscreen kiosk) so I can show this message at the beginning, but now always when user changes scene.

There are two problems:

  1. When in fullscreen and scene is changed, window size is reduced. Solution is to toggle fullscreen, but there is that message shown. (Change scene in full screen JavaFX)

  2. "Press ESC.." message cannot be disable due to security reasons (https://forums.oracle.com/forums/thread.jspa?threadID=2287258)

Thanks.

like image 854
Xdg Avatar asked May 23 '13 12:05

Xdg


People also ask

How do I exit JavaFX program?

stop() method and terminate the JavaFX application thread. If this attribute is false, the application will continue to run normally even after the last window is closed, until the application calls exit() . The default value is true.


2 Answers

JavaFX 8 has solved this problem with the addition of the following 2 methods:

  • Stage.setFullScreenExitHint(String)
  • Stage.setFullScreenExitKeyCombination(KeyCombination)

If you set the exit key combination to KeyCombination.NO_MATCH the pop-up message will be disabled completely.

like image 85
Geert Schuring Avatar answered Oct 24 '22 22:10

Geert Schuring


on 2. there's going to be a new feature in JavaFX8 to turn that warning of. The current proposal is that there's going to be a command line option. You can see the discussion on the openjfx mailing list (http://markmail.org/search/?q=+javafx.Stage.fullScreenWarning%3Dfalse#query:%20javafx.Stage.fullScreenWarning%3Dfalse+page:1+mid:ptqpgut2vvvhgkip+state:results)

like image 41
tomsontom Avatar answered Oct 24 '22 20:10

tomsontom