Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the location/Position of JFrame in the window

I am trying to find the Starting location/position of the JFrame in order to map the mouse cursor from the JFrame window to desktop. Is there anyway to find the X,Y position of JFrame ?

like image 827
nebula Avatar asked Oct 31 '11 06:10

nebula


1 Answers

You can use getLocation() or getLocationOnScreen() method of JFrame which are inherited from java.awt.Component.

like image 190
Harry Joy Avatar answered Sep 27 '22 22:09

Harry Joy