I wish to make use of a BBScrollingLabel referred to here: [B4X] BBScrollingLabel - rich text scrolling label, however I want to place it in a form which is part of a legacy project where the form was created in Scene Builder.
If I add a label to the form with Id lblScroll via Scene Builder, then:
not unexpectedly throws an error:
Is there a way to overcome this problem, perhaps by adding a BBScrollingLabel programmatically to the existing form?
If I add a label to the form with Id lblScroll via Scene Builder, then:
B4X:
Private lblScroll As BBScrollingLabel
not unexpectedly throws an error:
B4X:
display._show (java line: 587)
java.lang.ClassCastException: class b4j.example.bbscrollinglabel cannot be cast to class anywheresoftware.b4a.ObjectWrapper (b4j.example.bbscrollinglabel and anywheresoftware.b4a.ObjectWrapper are in unnamed module of loader 'app')
at anywheresoftware.b4j.objects.FXMLBuilder.setNodeField(FXMLBuilder.java:157)
at anywheresoftware.b4j.objects.FXMLBuilder.LoadLayout(FXMLBuilder.java:141)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:96)
at b4j.example.display._show(display.java:587)
at b4j.example.main._appstart(main.java:225)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:37)
at javafx.graphics@18.0.1/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics@18.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
at javafx.graphics@18.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics@18.0.1/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics@18.0.1/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:833)
Is there a way to overcome this problem, perhaps by adding a BBScrollingLabel programmatically to the existing form?