我如何在我的第一个fxml中加载我的第二个fxml
你最多,但每个控制器的Main AnchorPane
这个代码在fxml里面
<AnchorPane minHeight="-Infinity" minWidth="-Infinity" prefHeight="520" prefWidth="782.0" style="-fx-background-color: White; -fx-background-radius: 15px; -fx-border-radius: 12px;" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="1.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controller.CreateitemController">
然后在主屏幕,但这个代码用于在单击按钮时打开主屏幕内的第二个屏幕
@FXML
public void groupshow(ActionEvent event) throws IOException {
Parent root = FXMLLoader.load(getClass().getResource("/FX/creategroupshow.fxml"));
setting_page.getChildren().setAll(root);
}