【发布时间】:2014-10-31 12:28:10
【问题描述】:
我有以下代码来设置我的父布局:
public void start(Stage primaryStage) {
try {
Parent root = FXMLLoader.load(getClass().getResource("/view/BaseStructure.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
我想向父布局的right 添加另一个布局。我怎样才能在主课上做到这一点?
这是我的父布局 .fxml 文件的样子:
<VBox prefHeight="400.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.Main">
//more code here
<right>
//need my second layout here
</right>
</VBox>
【问题讨论】: