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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -