Fully Automated Key Strokes

Hi,

Here is my situation. I have a random program X that after I open it and then press the "up" key, then the "Enter" key, it does something cool. I would like to build a Java program that does this automatically. In other words, when I run my Java program, it will open up my program X, and automatically emulate the "up" key and then the "Enter" key without me doing anything. I know I can use Java's getRuntime() to open up the program but is there a way to have Java enter in keystrokes like the "up" key, "enter" key, and "Home" key by itself?

Thanks!

[577 byte] By [reponzo01a] at [2007-10-3 8:29:28]
# 1
See java.awt.Robot.
levi_ha at 2007-7-15 3:36:20 > top of Java-index,Java Essentials,Java Programming...
# 2
Awesome! Thanks!
reponzo01a at 2007-7-15 3:36:20 > top of Java-index,Java Essentials,Java Programming...