Javafx 适合加载的FXML的大小
我试图用多种方法解决我的问题。但什么都不管用 我有一个主应用程序WindowControllerJavafx 适合加载的FXML的大小,javafx,fxml,fxmlloader,Javafx,Fxml,Fxmlloader,我试图用多种方法解决我的问题。但什么都不管用 我有一个主应用程序WindowController @FXML private AnchorPane mainApplicationWindow; @FXML private AnchorPane workAnchorPane; @FXML private AnchorPane workAnchorPaneContent; 和相应的fxml <SplitPane dividerPositions="0.22690763052208834"
@FXML
private AnchorPane mainApplicationWindow;
@FXML
private AnchorPane workAnchorPane;
@FXML
private AnchorPane workAnchorPaneContent;
和相应的fxml
<SplitPane dividerPositions="0.22690763052208834" layoutX="55.0" layoutY="46.0"
prefHeight="160.0" prefWidth="200.0" styleClass="gt-splitpane"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items>
<AnchorPane id="splitPaneHorizontal" maxWidth="250.0" minWidth="250.0"
prefWidth="250.0">
<children>
<TableView fx:id="gtFamilyMemberTable" layoutX="20.0" layoutY="12.0"
onMouseClicked="#showInfoMember" prefHeight="200.0" prefWidth="200.0"
AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="10.0"
AnchorPane.rightAnchor="10.0" AnchorPane.topAnchor="5.0">
<columns>
<TableColumn fx:id="simNameColumn" maxWidth="110.0" minWidth="110.0"
prefWidth="-1.0" text="%simName"/>
<TableColumn fx:id="simSurnameColumn" maxWidth="110.0" minWidth="110.0"
prefWidth="-1.0" text="%simSurname"/>
</columns>
<styleClass>
<String fx:value="firstTypeTable"/>
<String fx:value="tableMembersAndRelations"/>
</styleClass>
</TableView>
<TableView fx:id="gtFamilyRelationTable" layoutX="20.0" layoutY="12.0"
onMouseClicked="#showInfoRelation" prefHeight="200.0"
prefWidth="200.0" AnchorPane.bottomAnchor="40.0"
AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="10.0"
AnchorPane.topAnchor="5.0">
<columns>
<TableColumn fx:id="relationSimLeftColumn" maxWidth="85.0"
minWidth="85.0" prefWidth="-1.0" text="%relation_sim"/>
<TableColumn fx:id="relationTypeColumn" maxWidth="50.0" minWidth="50.0"
prefWidth="-1.0" text="%relation_type"/>
<TableColumn fx:id="relationSimRightColumn" maxWidth="85.0"
minWidth="85.0" prefWidth="-1.0" text="%relation_sim"/>
</columns>
<styleClass>
<String fx:value="firstTypeTable"/>
<String fx:value="tableMembersAndRelations"/>
</styleClass>
</TableView>
<ToggleButton fx:id="buttonShowMemberTable" layoutX="23.0"
mnemonicParsing="false" text="ToggleButton"
AnchorPane.bottomAnchor="10.0"/>
<ToggleButton fx:id="buttonShowRelationTable" layoutX="125.0"
mnemonicParsing="false" text="ToggleButton"
AnchorPane.bottomAnchor="10.0"/>
</children>
</AnchorPane>
<AnchorPane fx:id="workAnchorPane">
<children>
<AnchorPane fx:id="workAnchorPaneContent" styleClass="workingPane"
AnchorPane.bottomAnchor="40.0"
AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="20.0"
AnchorPane.topAnchor="5.0">
</AnchorPane>
</children>
</AnchorPane>
</items>
</SplitPane>
问题是,在WorkAnchorPanecent中加载FXML后,尽管设置了FXML,但尺寸与workAnchorPane的尺寸不匹配
AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="5.0"
@编辑
Jest我试图绑定大小属性。但它对第二个控制器内的安可芬不起作用。您希望您的舞台采用安可芬的大小吗?注意-我希望您知道设置
AnchorPane.*Anchor
不会设置AnchorPane的大小。元素到AnchorPane父元素不是??处境
AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="10.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="5.0"