Here you can find the source of pressKeyCombo(Robot robot, int... codes)
public static void pressKeyCombo(Robot robot, int... codes)
//package com.java2s; //License from project: Open Source License import java.awt.Robot; import java.util.ArrayDeque; import java.util.Deque; public class Main { public static void pressKeyCombo(Robot robot, int... codes) { Deque<Integer> keyCodes = new ArrayDeque<Integer>(); for (int code : codes) { robot.keyPress(code);//from w ww. j a va 2 s . c o m keyCodes.push(code); } for (int key : keyCodes) robot.keyRelease(key); } }