How to press combination key using java Robot class ???


****************************************************************
COMPLETE SOURCE CODE FOR : PressCombinationKeyUsingRobot.java
****************************************************************


import java.awt.Robot;

import java.awt.event.KeyEvent;

public class PressCombinationKeyUsingRobot
{
public static void main(String[]args)
{
//Combination Alt+F4 is a window close order in windows operating system
//How to implement combination of Alt and F4 in using Robot class

try
{
Robot a=new Robot();
a.keyPress(KeyEvent.VK_ALT);
a.keyPress(KeyEvent.VK_F4);
a.keyRelease(KeyEvent.VK_ALT);
a.keyRelease(KeyEvent.VK_F4);
}
catch(Exception exception)
{
exception.printStackTrace();
}
}
}


****************************************************************
JUST COMPILE AND EXECUTE IT
****************************************************************