Find the location/Position of JFrame in the window

ⅰ亾dé卋堺 提交于 2019-11-30 18:37:58

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

Ajmal Muhammad P

you have to implement the MouseListener Interface and call the override methods

public void mouseEntered(MouseEvent me) 

and use

MouseEvent.getX();

MouseEvent.getXOnScreen();
Jframe.getX() // that will give you location of top left X coordinate of your jframe


Jframe.getY() // that will give you location of top left Y coordinate of your jframe
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!