java实现鼠标滑动选择效果

import java.awt.*;
import java.awt.event.InputEvent;

public class AutoOperationUtil {
    public static void main(String[] args) {
        slide(1198,259,662,259);
    }

    public static void slide(int x,int y,int x1,int y2) {
        try {
            Robot robot = new Robot();
            robot.delay(4000);
            System.out.println("开始移动");
            robot.mouseMove(x,y);
            robot.mousePress(InputEvent.BUTTON1_MASK);
            robot.mouseMove(x1,y2);
            robot.mouseRelease(InputEvent.BUTTON1_MASK);
        } catch (AWTException e) {
            e.printStackTrace();
        }
    }

}

你可能感兴趣的:(群控系统,鼠标滑动,自动化)