- Mastering JavaFX 10
- Sergey Grinev
- 92字
- 2021-06-25 21:21:52
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);
推薦閱讀
- 通信網絡基礎與設備
- 物聯網之魂:物聯網協議與物聯網操作系統
- Learning QGIS 2.0
- 計算機網絡與數據通信
- 面向云平臺的物聯網多源異構信息融合方法
- Building RESTful Web Services with Spring 5(Second Edition)
- 智慧光網絡:關鍵技術、應用實踐和未來演進
- 計算機網絡技術及應用
- Microsoft Power Platform Enterprise Architecture
- Intelligent Mobile Projects with TensorFlow
- 新媒體交互藝術
- 走近奇妙的物聯網
- React Design Patterns and Best Practices(Second Edition)
- 網絡信息安全工程技術與應用分析
- 網絡基本通信約束下的系統性能極限分析與設計