Robot right Click - Java java.awt

Java examples for java.awt:Robot

Description

Robot right Click

Demo Code


//package com.java2s;
import java.awt.AWTException;
import java.awt.Robot;

import java.awt.event.MouseEvent;

public class Main {
    public static void rightClick() {
        try {/*from w  w  w.jav  a 2s . c  om*/
            Robot robot = new Robot();
            robot.mousePress(MouseEvent.BUTTON3_DOWN_MASK);
            robot.mouseRelease(MouseEvent.BUTTON3_DOWN_MASK);

        } catch (AWTException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

Related Tutorials