I made an anchorpane with an fxml and a controller. I also made a borderpane with a view, fxml and another controller. How can I add the anchorpane inside the borderpane? The reason I want them in separate fxml and controller is that the borderpane is a lot of code and this would make everything look cleaner.
I thought it would work like this but it doesn't.
Borderfxml:
?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.textfield.*?>
<BorderPane fx:controller="Bordercontroller" xmlns:fx="http://javafx.com/fxml"
prefHeight="200" prefWidth="320">
<top>
</top>
<left>
</left>
<center>
</center>
<right>
<Anchorpane fx:id="Same id as my anchorpane"/>
</right>
<bottom>
</bottom>
</BorderPane>