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

+13 votes

im having trouble with this question: From the movie browser, clicking a "+" button on a movie card could switch to the "add
new movie to log" screen, with the name of the movie already filled in for the user

asked in CSC 305 Fall 2024 by (2k points)
+3

to clarify, I cant figure out how to add an onAction method for the button

+2

it might be easier to do that in Scenebuilder as you can visually see the button and apply the onAction

1 Answer

+4 votes

This might not be the answer you are looking for but a simple way of doing this would just be to ' App.setRoot()' to the movie log screen in a new method designed simply for this function and in the fxml window set the onAction event to be this method, just like we did in a bunch of our labs and in the project too

answered by (3k points)
+3

Thank you! I've tried adding a method for that function but it still wont work in the fxml file. I'm wondering if I need to add a fx:controller in the fxml file at the top (like in the other fxml files) but this causes errors.

...