如何将vbox大小设置为最小(包装内容)
问题描述:
我是新的javafx和fxml的东西,我无法实现将我的项目居中在我的边框窗格中。如何将vbox大小设置为最小(包装内容)
我FXML如下:
<BorderPane ...>
<top>
<Label styleClass="page-title" text="%startup_title">
<VBox.margin>
<Insets bottom="10.0" left="20.0" top="5.0" />
</VBox.margin>
</Label>
</top>
<center>
<VBox fx:id="vbox" >
<children>
<ProgressBar fx:id="progressBar" prefWidth="500.0" progress="0.0" />
<Label fx:id="progressLabel" styleClass="item-title" text="tt" />
</children>
</VBox>
</center>
</BorderPane>
这个问题似乎是,VBOX有一个与整个屏幕,和里面的物品都在TOP_LEFT。我知道我需要将vbox的宽度设置为最小值,而不是让它在边界窗格中展开,但是如何?
谢谢!
'对齐=“中心”' ? – fge 2015-02-10 10:41:16
是的,谢谢,我想知道我是如何在场景制作中错过的。 – Anthony 2015-02-10 10:44:25