Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+33 votes
asked in CSC285_Fall2018 by (1 point)
+3

Can you clarify how your question is different from this question that has already been answered? http://lovelace.augustana.edu/q2a/index.php/203/passing-data-from-one-gui-controller-another-gui-controller

+3

I tried creating an object of the controller class and calling the method in question on that object but it didn't work. So I wondered if there was another way that didn't involve creating a root and loader... and the rest.

1 Answer

+16 votes

You need to make a controller of the next window in the current window in order to use another controller. You will need to first make a FXMLLoader object. You can then declare a controller by calling the FXMLLoader object's method getController(). Once you have a controller of the next window you can call the methods from of the controller while still being in the current window.

answered by (1 point)
...