您好,欢迎来到外链网!
当前位置:外链网 » 站长资讯 » 专业问答 » 文章详细 订阅RssFeed

为什么esc不能退出全屏,没有esc怎么退出全屏

来源:互联网 浏览:81次 时间:2023-04-08

我要使功能在按ESC退出全屏模式后返回全屏模式.

?

有什么方法可以返回全屏显示吗?

例如,
要执行全屏模式,我使用了以下方法

?

@Overridepublic void init(Controller controller) 美国高防vps { sound.backgroundMusic(); menuButtons = new ArrayList<>(); createSubScenes(controller); createButtons(controller); createBackground(); createLogo(); controller.setScene(mainScene);}public void setScene(Scene scene) { Platform.runLater(() -> stage.setScene(scene)); Platform.runLater(() -> stage.setFullScreen(true));}

在舞台上,当我按ESC时,舞台退出到全屏.
enter image description here

enter image description here

然后在这个阶段,我希望能够返回到全屏模式.

最佳答案

防止通过ESC(或其他任何键)使用全屏模式:

?

?

stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);

如果您不处于全屏模式,请创建一个侦听器或方法以全屏执行:

?

stage.setFullScreen(true); 99821096