【发布时间】:2014-04-17 23:57:40
【问题描述】:
这是我到目前为止所得到的,但这是每 1000 毫秒打印一次鼠标位置,我如何对其进行编码,以便只有当我点击一个位置时它才会打印出位置
public static void main(String[] args) throws InterruptedException {
while (true) {
Thread.sleep(1000);
System.out.println("(" + MouseInfo.getPointerInfo().getLocation().x + ", " + MouseInfo.getPointerInfo().getLocation().y + ")");
}
}
【问题讨论】:
-
“我怎样才能编码它只有当我点击一个位置” 这给用户带来了什么功能?是间谍软件吗?
标签: java awt mouseevent mouse thread-sleep