JFoenix icon indicating copy to clipboard operation
JFoenix copied to clipboard

Exceptions throw when trying to use JFXTextField in Scenebuilder 16

Open ghost opened this issue 2 years ago • 4 comments

Trying to use in scenebuilder and the jar analysis report includes this:

Exception for: com/jfoenix/controls/FakeFocusJFXTextField.class
javafx.fxml.LoadException: 
unknown path:2
	at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
	at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown Source)
	at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown Source)
	at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
	at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
	at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
	at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.instantiateWithFXMLLoader(ExplorerBase.java:56)
	at com.oracle.javafx.scenebuilder.kit.library.util.ExplorerBase.exploreEntry(ExplorerBase.java:111)
	at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.exploreEntry(JarExplorer.java:83)
	at com.oracle.javafx.scenebuilder.kit.library.util.JarExplorer.explore(JarExplorer.java:65)
	at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.exploreAndUpdateLibrary(LibraryFolderWatcher.java:367)
	at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.runDiscovery(LibraryFolderWatcher.java:155)
	at com.oracle.javafx.scenebuilder.kit.library.user.LibraryFolderWatcher.run(LibraryFolderWatcher.java:100)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalAccessException: class javafx.fxml.FXMLLoader$InstanceDeclarationElement (in module javafx.fxml) cannot access a member of class com.jfoenix.controls.FakeFocusJFXTextField with modifiers ""
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Unknown Source)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(Unknown Source)
	at java.base/java.lang.Class.newInstance(Unknown Source)
	... 13 more

ghost avatar Sep 12 '21 23:09 ghost

Not a fix but helps maybe: I had other problems using Scene Builder 16 and switched back to 15.

CTaszus avatar Sep 17 '21 06:09 CTaszus

This is a problem with scenebuilder, you have to downgrade.

elegantShock2258 avatar Oct 14 '21 10:10 elegantShock2258

What I tend to do when SceneBuilder doesn't support a custom component is create and initialize those components in code instead of FXML... not ideal but it does let you continue to use SB for other stuff.

louhy avatar Feb 21 '22 18:02 louhy

Sometimes, SB is missing a library for a custom component. I think SB cannot resolve dependencies. My SOP is:

  1. Make sure a zero-argument-constructor exists
  2. Check any static and default constructor lines against uncommon objects

Edit: But as I wrote above this is a different problem. For this thread, a SB downgrade should to the job.

CTaszus avatar Feb 22 '22 06:02 CTaszus