JavaFX使用FXML文件构建borderPane

问题描述 投票:1回答:1

使用BorderPane布局,您可以使用单独的FXML文件填充其中的每个部分(顶部,左侧,中央,右侧和底部吗?

所以我会有一个main.fxml像:

<BorderPane fx:controller="main.mainController"  xmlns:fx="http://javafx.com/fxml" >

    <top>
        reads from top.fxml
    </top>

    <left>
        reads from left.fxml
    </left>

    <center>
        reads from center.fxml
    </center>

    <right>
        reads from right.fxml
    </right>

    <bottom>
        reads from bottom.fxml
    </bottom>

</BorderPane>

java javafx fxml borderpane
1个回答
0
投票

有两种方法可以做到:

在Java中添加

© www.soinside.com 2019 - 2024. All rights reserved.