例如,
要执行全屏模式,我使用了以下方法
@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
然后在这个阶段,我希望能够返回到全屏模式.
最佳答案
防止通过ESC(或其他任何键)使用全屏模式:
stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH);
stage.setFullScreen(true);
原文地址:https://www.jb51.cc/java/532866.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。