How to remove JavaFX stage buttons (minimize, maximize, close)

后端 未结 9 1196
你的背包
你的背包 2020-12-05 02:29

How to remove JavaFX stage buttons (minimize, maximize, close)? Can\'t find any according Stage methods, so should I use style for the stage? It\'s necessary fo

9条回答
  •  独厮守ぢ
    2020-12-05 02:35

    You can achieve this, you call the following methods on your stage object

    stage.initModality(Modality.APPLICATION_MODAL); // makes stage act as a modal
    stage.setMinWidth(250); // sets stage width
    stage.setMinHeight(250); // sets stage height
    stage.setResizable(false); // prevents resize and removes minimize and maximize buttons
    stage.showAndWait(); // blocks execution until the stage is closed
    

提交回复
热议问题