universengo
Member
B4X:
Sub mi_Action
Dim mi As MenuItem = Sender
SetCellValue(tblLuaChonDN.SelectedRow,3,mi.Text)
End Sub
'------------------------Set value in Table -------------------------
Sub GetLabel(RowIndex As Int, CellIndex As Int) As Label
Dim row() As Object = tblLuaChonDN.Items.Get(RowIndex)
Return row(CellIndex)
End Sub
Sub SetCellValue(RowIndex As Int, CellIndex As Int, Value As String)
GetLabel(RowIndex, CellIndex).Text = Value
End Sub
The message error:
B4X:
Error occurred on line: 145
java.lang.ClassCastException: java.lang.String cannot be cast to javafx.scene.control.Labeled
at anywheresoftware.b4j.objects.LabeledWrapper.setText(LabeledWrapper.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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 sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA$1.run(BA.java:215)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:748)
Many thanks.