【问题标题】:Setting the value of VBox to a different FXML VBox?将 VBox 的值设置为不同的 FXML VBox?
【发布时间】:2016-12-09 20:01:43
【问题描述】:

您可以使用 BorderPane 即:

    FXMLLoader loader = new FXMLLoader(getClass().getResource("contacts.fxml"));
    HBox root = loader.load();
    rootPane.setTop(root);
}

VBox 没有 .set(node) 方法。

【问题讨论】:

    标签: javafx load fxml vbox


    【解决方案1】:

    使用VBox(以及许多其他Panes),您只需修改children ObservableList,就像修改任何其他List一样。

    例如

    // add root as bottom-most child of rootPane
    rootPane.getChildren().add(root);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-25
      • 1970-01-01
      • 2014-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-04
      • 2014-03-15
      相关资源
      最近更新 更多