You can do it with a BorderPane ie:
FXMLLoader loader = new FXMLLoader(getClass().getResource("contacts.fxml"));
HBox root = loader.load();
rootPane.setTop(root);
}
The VBox does not have a .set(node) method.
With a VBox
(and with many other Pane
s) you just modify the children
ObservableList
the way you would modify any other List
.
E.g.
// add root as bottom-most child of rootPane
rootPane.getChildren().add(root);