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

后端 未结 9 1161
你的背包
你的背包 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:57
    stage.initModality(Modality.APPLICATION_MODAL);
    stage.setResizable(false);
    
    0 讨论(0)
  • 2020-12-05 02:57

    I found this answer here --> http://javafxportal.blogspot.ie/2012/03/to-remove-javafx-stage-buttons-minimize.html We can do it:

    enter code here
     @Override
        public void start(Stage primaryStage) {
            primaryStage.initStyle(StageStyle.UNDECORATED);
    
            Group root = new Group();
            Scene scene = new Scene(root, 100, 100);
    
            primaryStage.setScene(scene);
            primaryStage.show();
        }
    
    0 讨论(0)
  • 2020-12-05 02:57
    stage.initStyle(StageStyle.DECORATED);
    stage.setResizable(false);
    
    0 讨论(0)
提交回复
热议问题