This has nothing to do with your question.
AutoItX.winActivate("Untitled","")
AutoItX.send("Hello",False)
Autoit came to my mind firstly:
jAutoItX Library
Hello, About AutoIt and AutoIt4Java: AutoIt is a very useful automation scripting language for Microsoft Windows. It allows for GUI automation using a very simple syntax and can be useful for testing Windows applications. It is packaged with AutoItX which supports accessing AutoIt functions...www.b4x.com
You can send text to a window named Untitled with this code:
B4X:AutoItX.winActivate("Untitled","") AutoItX.send("Hello",False)