B4J UI is implemented with JavaFX not AWT so you can't. You could try the code below. If you don't explicitly set the cursor to a JavaFX one it appears to return Null. I'm not very well acquainted with JavaFX but it seems to work.
B4X:
Sub Button1_Click
Dim formm, scene, cursor As JavaObject
formm = MainForm
scene = formm.GetField("scene")
Log(scene.RunMethod("getCursor", Null))
cursor.InitializeStatic("javafx.scene.Cursor")
scene.RunMethod("setCursor", Array(cursor.GetField("CLOSED_HAND")))
Log(scene.RunMethod("getCursor", Null))
End Sub
B4J UI is implemented with JavaFX not AWT so you can't. You could try the code below. If you don't explicitly set the cursor to a JavaFX one it appears to return Null. I'm not very well acquainted with JavaFX but it seems to work.
B4X:
Sub Button1_Click
Dim formm, scene, cursor As JavaObject
formm = MainForm
scene = formm.GetField("scene")
Log(scene.RunMethod("getCursor", Null))
cursor.InitializeStatic("javafx.scene.Cursor")
scene.RunMethod("setCursor", Array(cursor.GetField("CLOSED_HAND")))
Log(scene.RunMethod("getCursor", Null))
End Sub
Well I need it for an app: remote administration... .when capturing screen not getting mousepointer... so need to know type of mousepointer i have in remote... to set it at my client window...
thought that in #IFJAVA... java.awt.Cursor.getType() will do the job... because already used other java.awt.* and worked...
I'm a bit rusty on the Windows API and have never used JNA Win32 but in Windows each input thread has a cursor and each window has an input thread to handle the message loop so each window has its own cursor - the desktop itself is a window. To get the cursor you would need to get the window handle of the window of interest and take it from there but I can't tell you how to do that with JNA.
I am posting here not only to answered by you (Thanks again) - hope, others see and if already know help me....
Found some code after a lot of searching - that may be help to extract the GetCursor needed (i just wanna know the type... of mousecursor of any windows is front or desktop) - So may be need to use HWND, may be others... my java knowledge is too little for that...