1
我有以下的代码,将我父布局:JavaFX的添加新的布局为母公司布局
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>