I am trying to figure out if there is a way to get a reference to the FXML for a given node.
For example I am dynamically loading views - assume I have a Pane referenced in the current Controller:
private void openView() {
FXMLLoader loader = new FXMLLoader();
Parent node = loader.load(this.getClass().getResource("MyView.fxml").openStream());
pane.getChildren().add(node);
node.requestFocus();
}
I would like to save which views were open so that I can relaunch them next time the window is open. Something like this:
private void saveOpenViews() {
pane.getChildren().forEach(child -> {
String fxmlLocation = child.getFXML();
etc....
}
}
I can't seem to find a way to get that back to persist what was open... Was hoping there was a way, other than manually tracking in another place.
Thanks.