There are several other options to manipulate Stage that are self-explanatory, like in the following examples:
// chapter1.StageFullScreen.javastage.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 ...