JavaFX - Communication Between Controllers
Why Stack Overflow recommends it
Stack Overflow users link it when someone has several FXML files with separate controllers and needs to access components or call methods across them.
Recommended by 3 people across 3 different months, 2015 to 2017.
What it is
An 18-minute intermediate JavaFX tutorial by Goran Vasic on letting multiple FXML controllers talk to each other. It uses a MainController as a mediator that forwards requests between controllers, built with SceneBuilder 2.0 and Eclipse with e(fx)clipse, with source code on GitHub.
What people said
Recommends kaloyant · 2015-04 · Stack Overflow · on “Mutiple FXMLs with multiple controllers in one Main FXML”
It has been a while, but finally I found an answer to my question. I found this [this video] video on YouTube and it is showing exactly what I needed. Although I found a couple of problems while I was doing the things from the video step by step. First of all, if I import another FXML file into the main FXML, like in this tutorial, SceneBuilder is importing the FXML like the things from the imported FXML are in the main FXML and this causes problems. What I mean is for example if you have a Button in the imported FXML, when you import it in the main FXML with SceneBuilder, the imported Button appears in the main FXML like a new Button with all the information for it (postion, onClickMethod, etc.)
Recommends PrashantP · 2016-05 · Stack Overflow · on “JavaFX - Components are null when initializing Controller”
Problem 1 : have you added given FXML directly in main_window.fxml or you have included this FXML in main_window.fxml? Problem 2 : To access components located in another fxml through your controller of first fxml please refer this link : [this video] I was facing same problem.:)
Recommends zlakad · 2017-12 · Stack Overflow · on “Initializing second window in separate class (e.g. ChoiceBox)”
Please, watch this video, since you've asked a question 1 hr ago, and nobody answered. Right now, I just have no time enough to help you... [this video]