JAVA程序 - 获取鼠标点击桌面某处的绝对水平 x ,y坐标,注意不是点击...
发布网友
发布时间:2024-10-14 21:17
我来回答
共1个回答
热心网友
时间:2024-10-14 22:19
import java.awt.MouseInfo;
import java.awt.Point;
public class MouseTest {
public static void main(String args[]){
Point mousepoint = MouseInfo.getPointerInfo().getLocation();
System.out.println(mousepoint.x+" "+mousepoint.y);
}
}
测试通过,参考资料:http://andyjojo.javaeye.com/blog/357393