You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fx:include tag supports the explicit definition of a resourceBundle that should be used for the included fxml file. However there are at leased 3 problems with the JavaFX default behaviour due to bugs in the FXMLLoader:
You can't define a Locale. Instead FXMLLoader uses Locale.getDefault(). This is a miner problem because you can set the default in your application
Loading resources for included fxml files only works when there is a resourceBundle defined for the root FXMLLoader. Otherwise a NullPointerException is thrown by the FXMLLoader.
FXMLLoader uses the classloader of the root resourceBundle to load included resourceBundles. However, it is possible (and for our use case typical) that the classloader is null for a resourceBundle. This is the case when the class was loaded by the bootstrap classloader of Java. For us this means: We always get a NullPointerException when trying to load a resourceBundle for an included fxml file.
There is a bug filed for this issue but it will only be resolved for JavaFX 9. This blog post describes the problem and a possible workaround.
We should do the following:
make sure that there is a classloader defined for the resourceBundle. For this we could internally use the ResourceBundleWrapper proposed in the linked blog post.
make sure that there is always a resourceBundle defined for the root FXMLLoader even when the user doesn't provide one via the FluentViewLoader.
Note: In this issue we focus on explicit configuring a resource bundle via fx:include. In the future we may support implicit loading of resourceBundles via naming convention (see #207).
The text was updated successfully, but these errors were encountered:
The
fx:include
tag supports the explicit definition of a resourceBundle that should be used for the included fxml file. However there are at leased 3 problems with the JavaFX default behaviour due to bugs in the FXMLLoader:Locale.getDefault()
. This is a miner problem because you can set the default in your applicationNullPointerException
is thrown by the FXMLLoader.null
for a resourceBundle. This is the case when the class was loaded by the bootstrap classloader of Java. For us this means: We always get aNullPointerException
when trying to load a resourceBundle for an included fxml file.There is a bug filed for this issue but it will only be resolved for JavaFX 9. This blog post describes the problem and a possible workaround.
We should do the following:
Note: In this issue we focus on explicit configuring a resource bundle via
fx:include
. In the future we may support implicit loading of resourceBundles via naming convention (see #207).The text was updated successfully, but these errors were encountered: