We are working on Javafx project which was working fine on Java8. Recently, We have updated the project with Java17. We are able to resolve the issues for the IDEA.
Seems like after Java 9+ they have strictly encapsulated all classes. To use this we have to use "export" "open" keywords in vm options or define "ALL-UNNAMED" in the compile runtime.
This is running perfectly on IDEA. Now, We are trying to load fxml files in scene builder but scenebuilder unable to find out these classes. We have added all required jar files to scenebuilder but still unable to load the FXML files.
Following errors scenebuilder showing:
java.lang.ClassNotFoundException: com.sun.javafx.scene.TreeShowingExpression
Libraries we are using:
jfoenix.jar. fx_progress_circle.jar. fontawesomefx.jar
We are getting issues on the JFX views on JFXCheckbox, JFXRadioButton, JFXSpinner etc.
We have tried every possible solution, but couldn't solve it.
Any help would be appreciated. thanks.
For an example of creating a custom component library and importing it into SceneBuilder (with sample code and screenshots) see:
As noted in comments, currently with recent versions of jfoenix and SceneBuilder, even if you perform the steps in this post:
JFXSpinner, JTextfield does not seems to work on scenebuilder version 17. There is probably more controls that are not working too.
If you follow these steps and find obvious bugs, then you may wish to report these to the jfoenix team.
Importing jfoenix and fontawesomefx libraries:
The progress circle thing isn't in Maven central, you will need to import it via the "Add Library/FXML from File System" option of the "JAR/FXML Manager" dialog (I didn't try that).
jfoenix github page says it needs to be 9+ to work with Java 9+. I don't think jfoenix is all that well maintained and (from some other questions about the library on StackOverflow), it mostly works in recent SceneBuilder builds, but not well and some of its components don't behave well in SceneBuilder.
Related:
Similarly, fontawesomefx has version 9.1.2 which has a manifest with an automatic module in it maven repo entry, which allows it to work. I don't know where up-to-date documentation on that project is, but it appears that there are multiple packages that you can use depending on the font library you want to access, I just picked the one which uses the fontawesome icon library.
Related:
JavaFX 8 to JavaFX 17 conversion approach advice
I suggest: