I need to run an external application from within my Java code. I can run the application with Runtime r = Runtime.getRuntime() and then r.exec(…), however, this brings up the GUI of the application. And I still need enter some settings in some fields and press enter. So:
Is there some way to handle a GUI (filling out fields, pressing “return”..etc) from within Java code?
Thanks in advance for any answers,
Anas
Use the AWT Robot class:
“This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed.”