簡體   English   中英

如何控制(移動)鼠標光標?

[英]How to control (move) the mouse cursor?

如何使用 Java 移動鼠標光標(Windows)? 我有一對不斷更新的價值觀。 我想用它們來控制光標。

您將需要使用 Robot 類。

Robot r = null;
try {
    r = new Robot();
} catch (AWTException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}
r.mouseMove(x, y);//x is the horizontal position on the screen, y is the vertical

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM