Answer the question
In order to leave comments, you need to log in
How to pass text to another window in javafx?
There are two windows, two controllers, how can I transfer text from one window to another window??
I tried to call the constructor of the second window to pass the text in the main window, but the Controller of the second window is apparently called before the call of the window itself, and therefore I have null instead of the String variable.
Answer the question
In order to leave comments, you need to log in
Issue resolved, I figured it out.
Can be passed using the class constructor, which is called in the controller of the main class. For example, launch a window by clicking on a button, in this case the controller has a method on the button, in which the constructor is passed, and that's it =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question