[B4X] Create dynamically B4Xpanel
Well..
I ve decided to use XUI at my projects after years... so i am confused about creating my pane on the fly adding into them textfields.. without using loadlayout...
So for example I want to create an array of 10 panel with 10 b4x edittext fields...
How will be that on the fly... (?)
but...
Well..
I ve decided to use XUI at my projects after years... so i am confused about creating my pane on the fly adding into them textfields.. without using loadlayout...
So for example I want to create an array of 10 panel with 10 b4x edittext fields...
How will be that on the fly... (?)
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private xbase As B4XPanel 'at a layout...
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Dim p(10) As B4XView = xui.CreatePanel("")
p(1).SetLayoutAnimated(0, 0, 0,100, 50) 'is that really needed ?
xbase.AddView(p(1), 0, 0,100,50)
'For example let's add one panel... but...
but...
B4X:
main._appstart (java line: 62)
java.lang.ClassCastException: class anywheresoftware.b4j.objects.PaneWrapper$ConcretePaneWrapper$NonResizePane cannot be cast to class [Lanywheresoftware.b4a.objects.B4XViewWrapper; (anywheresoftware.b4j.objects.PaneWrapper$ConcretePaneWrapper$NonResizePane and [Lanywheresoftware.b4a.objects.B4XViewWrapper; are in unnamed module of loader 'app')
at b4j.example.main._appstart(main.java:62)
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:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:95)
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(Native Method)
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:834)