This is probably the shortest snippet ever, but I find it quite useful
With it you can turn an object into a javaobject and then run a method on it
EventHandlers become easier too
B4X:
Sub asJavaObject(j As JavaObject) As JavaObject
Return j
End Sub
With it you can turn an object into a javaobject and then run a method on it
B4X:
'canvas1 defined in designer
asJavaObject(canvas1).RunMethod("setWidth",array(100.00))
EventHandlers become easier too
B4X:
Dim myEventHandler As Object = asJavaObject(ob).CreateEventFromUI("javafx.event.EventHandler", _
handlerName,False)
asJavaObject(ob).RunMethod(eventName, Array(myEventHandler))