Skip to content
Aaron Ebnöther edited this page May 20, 2018 · 3 revisions

The following Naming Conventions are used by the mvvmFX framework:

FxmlView

For every FxmlView there has to be a fxml file with the same (case-sensitive) name in the same package.

For example when your view class is com.mycompany.myapp.MySpecialView.java.

  • /com/mycompany/myapp/MySpecialView.fxml is correct
  • /com/mycompany/myapp/myspecialview.fxml is wrong because of only lower case characters.
  • /com/mycompany/myapp/mySpecialView.fxml is wrong because the first character doesn't match
  • /MySpecialView.fxml is wrong because it's in the wrong directory.

Please be aware that when using Maven as build automation tool there are different directories for Java source code files and other resource files. While java files are located in src/main/java, your FXML files are treated like resource files so they have to be placed into src/main/resources directory. In this case you have to recreate the directory structure of your packages in your src/main/resources directory:

  • src/main/resources/com/mycompany/myapp/MySpecialView.fxml would be correct.

If for some reasons these naming conventions cannot be fulfilled you can use the @FxmlPath annotation to configure a custom path. See Deviating FXML location for more informations.