B4J Question [Solved] Web Image Example error in B4J

Theera

Well-Known Member
Licensed User
Longtime User
refer to https://www.b4x.com/android/forum/threads/b4x-webp-images.119990/

I've studied WebP Image on B4A and B4J. B4A example is OK ,But B4J example is not OK. How do I do?
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
b4xpagesmanager._createpageifneeded (java line: 307)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:522)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:468)
at b4j.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:307)
at b4j.example.b4xpagesmanager._showpage(b4xpagesmanager.java:722)
at b4j.example.b4xpagesmanager._addpage(b4xpagesmanager.java:113)
at b4j.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:120)
at b4j.example.b4xpagesmanager._initialize(b4xpagesmanager.java:491)
at b4j.example.main._appstart(main.java:58)
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:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
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:174)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.RuntimeException: Object should first be initialized (B4XView).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:49)
at anywheresoftware.b4a.objects.B4XViewWrapper.asImageViewWrapper(B4XViewWrapper.java:139)
at anywheresoftware.b4a.objects.B4XViewWrapper.SetBitmap(B4XViewWrapper.java:581)
at b4j.example.b4xmainpage._b4xpage_created(b4xmainpage.java:46)
at b4j.example.b4xmainpage.callSub(b4xmainpage.java:77)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:497)
... 23 more
 

teddybear

Well-Known Member
Licensed User
refer to https://www.b4x.com/android/forum/threads/b4x-webp-images.119990/

I've studied WebP Image on B4A and B4J. B4A example is OK ,But B4J example is not OK. How do I do?
B4X:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
The log is a warning message.
I guess your imageview is not initialized, you'd better post a small project.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
My TestProject is attached as belows
 

Attachments

  • WebP_Image.zip
    27.3 KB · Views: 118
Upvote 0

teddybear

Well-Known Member
Licensed User
It's like I guessed. you did not do initializing imageview. you may initialize it in Designer.
zip is attached and updated
 

Attachments

  • WebP_Image.zip
    27.4 KB · Views: 102
Last edited:
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
It's like I guessed. you did not do initializing imageview. you may initialize it in Designer.
zip is attached and updated
How do I initialize it in Designer? I have checked in Designer about part of coding,there is notthing.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
How do I initialize it in Designer? I have checked in Designer about part of coding,there is notthing.
Ok ,I have forget to copy designer from B4A to B4J. I understand it . Thank you for kind of you.
 
Upvote 0
Top