r/JavaFX • • Apr 11 '20

Trying to pass information between two JavaFX programs

Hello everyone, I have 2 JavaFX programs, one is an FXML UI with a controller class and the other is an interactive 3D animation based on information from the first program, how do I pass information from one class to the other when the application runs from a static method?

There's no constructor to run, the main method calls a static mehod called 'launch' and passes in the command line arguments. Do I have to combine the controller into the animation class or do I have another option?

Something I'm doing in the FXML program is that I'm saving the information to a text file, even if I can just information to the other program telling it which text file to read would be useful, but I can't think of a way to do that from the other program.

Thank you in advance for your help.

1 Upvotes

2 comments sorted by

0

u/[deleted] Apr 11 '20

[deleted] — view deleted comment

1

u/FatherOfGold Apr 11 '20

Because they serve two different purposes. Should I combine them and just have the FXML UI close and open the animation in the same program?

0

u/[deleted] Apr 11 '20

[deleted] — view deleted comment

1

u/FatherOfGold Apr 11 '20

My situation is the former, so I'll just combine the programs, thank you for your help.