官术网_书友最值得收藏!

Setting fullscreen and other window options

There are several other options to manipulate Stage that are self-explanatory, like in the following examples:

// chapter1.StageFullScreen.java
stage.setFullScreen(true);
stage.setIconified(true);
stage.setMaxWidth(100);
//...

The only unusual thing about this API is the extra fullscreen options—you can set up a warning message and key combination to exit fullscreen using the following methods:

 primaryStage.setFullScreenExitHint("Exit code is Ctrl+B");
primaryStage.setFullScreenExitKeyCombination(KeyCombination.valueOf("Ctrl+B"));

Note the convenient KeyCombination class, which can parse names of shortcuts. If you prefer more strict methods, you can use KeyCodeCombination instead:

KeyCodeCombination kc = new KeyCodeCombination(KeyCode.B, KeyCombination.CONTROL_DOWN);
主站蜘蛛池模板: 如皋市| 富源县| 宝清县| 原阳县| 阿坝县| 盈江县| 年辖:市辖区| 五寨县| 托里县| 额敏县| 东台市| 香河县| 牟定县| 陈巴尔虎旗| 郎溪县| 大化| 抚州市| 敖汉旗| 民权县| 平泉县| 阳朔县| 宁夏| 苍梧县| 黄石市| 甘泉县| 巨野县| 宁国市| 信丰县| 凤庆县| 永吉县| 杨浦区| 庆安县| 合肥市| 平顶山市| 凤翔县| 琼结县| 志丹县| 黄石市| 神木县| 固始县| 富蕴县|