我有这个FXML是在SceneBuilder预览可以正常使用,并作用于NetBeans的JavaFX的示例应用程序完全不同的(所以没有什么多余的,可以打破它的行为)。 (见sceencast )
我需要2个TitledPanes来自动调整与窗口根据(各占一半)(因为它工作在SceneBuilder预览)。
<AnchorPane id="AnchorPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="798.0" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication2.Sample">
<children>
<VBox id="vBox1" prefWidth="770.0" spacing="25.0" AnchorPane.bottomAnchor="25.0" AnchorPane.leftAnchor="25.0" AnchorPane.rightAnchor="25.0" AnchorPane.topAnchor="25.0">
<children>
<TitledPane id="titledPane1" fx:id="test" prefWidth="748.0" text="Admin" VBox.vgrow="ALWAYS">
<content>
<AnchorPane id="Content" minHeight="0.0" minWidth="0.0">
<children>
<TableView id="tableView1" prefWidth="718.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0" />
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane id="titledPane2" prefWidth="748.0" text="Resellers" VBox.vgrow="ALWAYS">
<content>
<AnchorPane id="Content" minWidth="0.0" prefWidth="744.0">
<children>
<TableView id="tableView2" prefWidth="200.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="14.0" />
</children>
</AnchorPane>
</content>
</TitledPane>
</children>
</VBox>
</children>
</AnchorPane>