I have two scenes, one who serves as a main scene and one who serves as a wizard.
When the user clicks a button on the wiz scene
, I want a new tab added to the tabpane in the main scene
.
The problem is that the program thinks I am referencing to a tabPane in the wizard scene, while it's actually placed in the main scene.
So my question is, how can I reference to elements in another scene? (actually another FXML document)
Note: I am using scene builder
By the way, I got it to work using : How do I access a UI element from another controller class in JavaFX?
But I understand this isn't the recommended approach, so what is?
It could be that I am approaching this all wrong.. But all I want is a new window opening with a button inside, and when the user press the button inside the new window, a new tab should be added to the main window.