java - Catch LeaveFullscreen in JavaFx -
i'm writing javafx-application , want force fullscreen. tried
mainview.getlayout().setonkeypressed(event -> { if(event.getcode() == keycode.escape){ mainview.getstage().setfullscreen(true); } }); mainview.getlayout() returns stackpane
but that's not clean solution, when leaves fullscreen automatically switches fullscreen. want catch leavefullscreen , nothing instead of leave , switch back.
the fullscreenexitkey property of stage can set keycombination.no_match. prevents combination of keys exiting full screen mode.
stage.setfullscreenexitkeycombination(keycombination.no_match); stage.setfullscreen(true);
Comments
Post a Comment