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

+15 votes

After I add a movie, the movie list doesn't display the name of it. But after I add the second movie, the name of the first movie is displayed. How to fix this error?

asked in CSC305 Fall 2022 by (1 point)

1 Answer

+7 votes

This bug tends to arise if your code changes back to the MovieList.fxml scene (and thus initialize your ListView within that scene from the list of movies) before you create the new Movie object and add it to the list of movies.

To fix it, make sure that you update the list before you switch back to the other GUI.

answered by (508 points)
...