I have been through java docs, java online courses/presentations on youtube and threads on stackoverflow, but never found an easy and great method to interact between different views on javafx applications. And most of the times examples have been showing only one view at the time.
Researches I have done so far is that a fxml file needs a controller to be hooked with, and if you have more fxml files, the proper way would be to get a controller to each of them.
What I still do not understand is the Abstract Parent class. Why is it created an instance of that in the javafx fxml application at the beginning on start method? Do I need to instantiate it again when I am trying to load a new fxml file? Same goes to the FXMLLoader. What exactly is fx:root construct? Other researches I have observed are that you do not necessarily need multiple stages or scenes to load a new fxml file.
What I am trying to achieve is an lightweight and simple looking chat application in javafx. Right now I am working on the Client application and planning to apply 3 fxml files: login, chat and submit new user. I do not know wether I should create new stage and scene, only new scene or just replacing the fxml file, one at the time, inside the current stage & scene? Basically I want login to point me to chat screen, new user to create acc screen and both of them to point me back to login screen.
The part I am struggling with is the FXMLLoad part and who is parent and children to who or are all of them parent? And how to organize the files. I have uploaded two images to show you how I am thinking and what I want to approach. Is it really possible to load a new fxml at time to current stage & scene, based on ActionEvent? If yes, how can i approach that?
I hope I made it clear.