B4J Question strange setautocomplete problem

tufanv

Expert
Licensed User
Longtime User
Hello,

In one of my projects this works fine :

Code: Copy
Sub SetAutoComplete(Items As List, Field As TextField)
    Dim jo As JavaObject
    jo.InitializeStatic("org.controlsfx.control.textfield.TextFields")
    jo.RunMethod("bindAutoCompletion", Array(Field, Items))
End Sub

Code: Copy
SetAutoComplete(listbittrex,txtcoin)


in another project with the same code i keep getting the error for the line
Code: Copy
 jo.InitializeStatic("org.controlsfx.control.textfield.TextFields")


Code: Copy
Error occurred on line: 83 (Main)
java.lang.ClassNotFoundException: org.controlsfx$control$textfield$TextFields
    at anywheresoftware.b4j.object.JavaObject.getCorrectClassName(JavaObject.java:288)
    at anywheresoftware.b4j.object.JavaObject.InitializeStatic(JavaObject.java:74)
    at b4j.example.main._setautocomplete(main.java:245)
    at b4j.example.main._jobdone(main.java:219)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:613)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:482)
    at anywheresoftware.b4a.keywords.Common.access$0(Common.java:462)
    at anywheresoftware.b4a.keywords.Common$CallSubDelayedHelper.run(Common.java:536)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
    at java.base/java.lang.Thread.run(Thread.java:844)

Am I missing stg ?

little project attached for testing
 
Last edited:
Upvote 0
You really should do more debugging when you have such an error. For me it looks more like you are waisting our time because you are too lazy to search for the problem
Can you help me learn how could i do more debugging on this as I tried some hours trying to figure out the problem without posting here , I also checked my previous projects. I would be very happy if i can learn how could I do it better so next time I can figure the problem myself ?
 
Upvote 0
This line in your stack trace is the clue to the problem:
Code: Copy
java.lang.ClassNotFoundException: org.controlsfx$control$textfield$TextFields
Most clues will be found in your stack trace. In this case, the JVM can't find a class (ClassNotFoundException) and we know the package that contains the missing class (org.controlsfx...) so we can infer that the jControlsFX library is missing.
 
Upvote 0
Back
Top