To share a snippet which changes the form cursor to an image which is located in the files (dirasset) folder.
Acknowledgement: just found this thread, which relates as showing an animated cursor - was not aware prior posting this snippet.
The image arrowup.png mentioned as example:
Acknowledgement: just found this thread, which relates as showing an animated cursor - was not aware prior posting this snippet.
B4X:
' Example: SetFormCursor(MainForm, "arrowup.png")
Sub SetFormCursor(frm As Form, imagefile As String)
Dim img As Image
img.Initialize(File.DirAssets, imagefile)
Dim joImageCursor As JavaObject
joImageCursor.InitializeNewInstance("javafx.scene.ImageCursor", Array(img))
Dim joCursor As JavaObject = frm.RootPane
joCursor.RunMethod("setCursor", Array(joImageCursor))
End Sub
The image arrowup.png mentioned as example:
Last edited: