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

后端 未结 9 1202
你的背包
你的背包 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:42

    If you want to disable only the maximize button then use :

    stage.resizableProperty().setValue(Boolean.FALSE);
    

    or if u want to disable maximize and minimize except close use

    stage.initStyle(StageStyle.UTILITY);
    

    or if you want to remove all three then use

    stage.initStyle(StageStyle.UNDECORATED);
    

提交回复
热议问题