如何在Scene Builder中使窗口全屏/最大化? [英] How to make window fullscreen/maximized in Scene Builder?
本文介绍了如何在Scene Builder中使窗口全屏/最大化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在SceneBuilder中为我的JavaFX应用程序创建了一个视图。我希望我的观点最大化。如何在SceneBuilder或 .fxml
文件中实现此目的?
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?
推荐答案
您不能使用Scene Builder,因为 最大化
或 fullScreen
是 Stage
而不是场景中设置的布局。
You cannot do that using Scene Builder, since maximize
or fullScreen
are properties of the Stage
and not the layouts set on the scene.
您可以在场景中加载并设置 .fxml
,然后在舞台上设置场景。
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)
- 到最大化舞台并填满屏幕。 -
setFullScreen(boolean)
- 将舞台设置为全屏,未修饰的窗口。
setMaximized(boolean)
- To maximize the stage and fill the screen.setFullScreen(boolean)
- To set stage as full-screen, undecorated window.
这篇关于如何在Scene Builder中使窗口全屏/最大化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文