How to make window fullscreen/maximized in Scene Builder?

前端 未结 5 1219
别跟我提以往
别跟我提以往 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:54

    You cannot do that using Scene Builder, since maximize or fullScreen are properties of the Stage and not the layouts set on the scene.

    You can load and set the .fxml on the scene and later set the scene on the stage.

    The following methods can be used on the stage :

    • setMaximized(boolean) - To maximize the stage and fill the screen.
    • setFullScreen(boolean) - To set stage as full-screen, undecorated window.

提交回复
热议问题