【发布时间】:2019-07-23 11:32:21
【问题描述】:
我想让功能在按ESC退出全屏模式后返回全屏模式。
有什么方法可以返回全屏?
例如, 要执行全屏模式,我使用了如下方法
@Override
public void init(Controller controller) {
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
然后在这个阶段,我希望回到全屏模式。
【问题讨论】:
-
stage.setFullScreen(true)? -
我的意思是..当我按ESC,然后如何再次进入全屏模式?
-
还是不明白:你想达到什么目的?究竟是什么问题?请提供一个minimal reproducible example 来说明问题。
-
有意义吗?
-
@kleopatra nvm,我解决了这个问题。谢谢