How to make window fullscreen/maximized in Scene Builder?

前端 未结 5 1334
别跟我提以往
别跟我提以往 2021-02-03 20:03

I am making a view in SceneBuilder for my JavaFX application. I want my view to be maximized. How can I achieve this in SceneBuilder or the .fxml file?

5条回答
  •  耶瑟儿~
    2021-02-03 20:49

    I agree with Yemmy1000. primaryStage.setMaximized(true) works fine for me.

        primaryStage.setScene(new Scene(root, 1800, 850));
        primaryStage.setMaximized(true);
    

    This code will go to width: 1800 and height:900 when restored down from maximum.

提交回复
热议问题