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

+35 votes

Is there a correct way for passing information from one GUI to another?

asked in CSC285_Fall2018 by (1 point)

2 Answers

+14 votes

In general, I'd recommend following the same pattern I used in the Day14 example, on the line:

nextController.updateName(textfieldName.getText());

In your projects, you might pass a Video or ProjectData object, instead of just a String, but the idea is the same...

answered by (508 points)
+13 votes

Make it static.
For example, you should create a static variable and a static method to return that variable...

answered by (1 point)
...