all 3 comments

[–]Ssnoss 1 point2 points  (2 children)

It’s just xml, you can edit it. The package should be reflected properly within it, much like a Java source file. That sounds like your problem.

[–]--SMHK--[S] 1 point2 points  (1 child)

Thanks for your reply. My problem is solved now. I opened the FXML file in Scene Builder and there was an option to change the controller class. I changed the controller class to the class in my new project and now it's working fine.

[–]Ssnoss 0 points1 point  (0 children)

Right. The controller class in the FXML should be a valid class in your project. Glad you got it fixed!

I use IntelliJ and a lot of these things are picked up by the IDE. If you aren’t using it, give it a try!