I have created a JavaFx8 Maven project in eclipse. I have put my fxml files in /src/main/resources/fxml/. I am able to the load the fxml from the java files using FxmlLoader. But, I'm not able to pick the controller class from Fxml file using Scenebuilder.
What should I do to be able to see the controller class automatically in the Scenebuilder tool ?
I have found a similar question, but the answer wasnt clear. I wasnt able to login to the jira case.
Tell JavaFX Scene Builder where to look for controller classes
You Must Put FXML beside its Controller in the same Package And Scene Builder will see the Controller
I know this is an old question but I have put in a pull request on the Gluon release of Scenebuilder that modifies the controller search path, here. There is also a corresponding issue raised here.
If the pull request gets votes it may get merged sooner. If someone could also build and test it on Mac and Windows platforms that would be of great assistance too.
I have put the fxml file in the same folder /src/main/java initially. Then, I mapped all the elements/controller using scenebuilder.
Once mapping is done, I have moved the fxml to /src/main/resources folder. This works.
Automated solution for same thing: Locate your controller and fxml files as same as standard java-fx projects. I mean put your fxml and controller files at the same place same as non-maven projects. Then add the following maven configuration into your project.