B4J Question Reading Mouse Position

TheSirOwl

New Member
Licensed User
Longtime User
My daughter is learning to program in Java and just wrote a program for eyes to follow the mouse position. I would like to try the same thing here in B4J. How do I read the pointer position when it is in a UI or Panel
 

derez

Expert
Licensed User
Longtime User
Example for a panel named anchor :
B4X:
Sub anchor_MouseMoved (EventData As MouseEvent)
Log(EventData.X & " " & EventData.Y)   
End Sub
 
Upvote 0

FrenchDeveloper

Member
Licensed User
Longtime User
Hello,
It seems it doesn't work when the panel is transparent
It works when I remove these lines :
MainForm.SetFormStyle("TRANSPARENT")
MainForm.BackColor = fx.Colors.Transparent

May be I'm wrong but I think it may be possible to get the absolute mouse position from the screen and not from an object
 
Upvote 0
Top