Also see here
@FXML
private void mnuUserLevel_onClick(ActionEvent event) {
FXMLLoader loader = new FXMLLoader(getClass().getResource("DBedit.fxml"));
loader.setController(new DBeditEntityUserlevel());
try {
Node n = (Node)loader.load();
AnchorPane.setTopAnchor(n, 0.0);
AnchorPane.setRightAnchor(n, 0.0);
AnchorPane.setLeftAnchor(n, 0.0);
AnchorPane.setBottomAnchor(n, 0.0);
mainContent.getChildren().setAll(n);
} catch (IOException e){
System.out.println(e.getMessage());
}
}
The scenario is to load a child fxml into parent AnchorPane. To make the child to stretch in accords to its parent use AnChorPane.setxxxAnchor command.