Robot press Tab Key - Java java.awt

Java examples for java.awt:Robot

Description

Robot press Tab Key

Demo Code


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

import java.awt.event.KeyEvent;

public class Main {

    public static void pressTabKey() {
        Robot robot = null;/*from www . j  av a  2s  . co  m*/
        try {
            robot = new Robot();
        } catch (AWTException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        robot.keyPress(KeyEvent.VK_TAB);
        robot.keyRelease(KeyEvent.VK_TAB);
    }
}

Related Tutorials