I wanted to ask if there Is any way to get the Coordinates my coursor has within my window?
like "e.getX()" when using an Event, but without having to use an event?
or is there any sort of algorithm like getting the absolute position of the mouse and subtracting the position of the Frame?
Thanks Already and sorry for my bad english.
Ok Guys i found the solution now:
MouseInfo.getPointerInfo().getLocation().x - XYZ.getLocationOnScreen().x
MouseInfo.getPointerInfo().getLocation().y - XYZ.getLocationOnScreen().y
with XYZ being the reference to the Frame / Panel / whatever being used
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With