You still haven't defined the requirements. Why do you do this? When do you do this?
a) When the text area is full
b) when the use clicks a button
c) for every character that is typed
Ask a clear question with clear requirements and you might get an answer...tomorrow... because I'm signing off soon.
Well the Robots class is what you want then. Use a timer to trigger the Robot keyPress() and keyRelease() methods:
eg:
Robot bot = new Robot(); //throws an exception, so you need a try block
...in timer event handling code...
for (char c : stringOfCharsToType) {
int keyCode = convertCharToKeyCode(c);
bot.keyPress(keyCode);
bot.keyRelease(keyCode);
}
The hardest bit is then to convert the characters to virtual key codes (eg: KeyEvent.VK_A etc).
Hope that helps.