Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tell JavaFX Scene Builder where to look for controller classes

In Oracle's JavaFX Scene Builder it is possible to specify which Java class will be used as the controller for a scene. It's member variables will be populated by the FXMLLoader with instances of the controls. If the FXML file is in the same directory as the Java files, the Scene Builder can automatically suggest the class to use as controller, and from there, suggest the names of member variables in which a reference to the instance of a specific control should be placed.

When using Maven as a build tool, resource files (like the FXML files) are placed in a different directory than source files (like the Java files). Because of this, the Scene Builder is unable to find the Java file and inspect if for suitable properties.

Is there a ways to the the Scene Builder, where it should look for Java files to inspect?

like image 448
Feuermurmel Avatar asked Nov 11 '22 16:11

Feuermurmel


1 Answers

As of right now, this is not possible. There's a feature request to add the functionality in the future:

https://javafx-jira.kenai.com/browse/DTL-5124

As a workaround, you might be able to configure the maven-resources-plugin to include your source directory as a resource directory:

http://maven.apache.org/plugins/maven-resources-plugin/

If you're using Gradle and Intellij IDEA 13, be aware of this issue:

http://youtrack.jetbrains.com/issue/IDEA-118280#comment=27-654638

like image 132
Ryan J Avatar answered Nov 15 '22 05:11

Ryan J