Hi,
I'd like to know how to do the following things :
1 - Open a program ; It works, but I don't know how to write in it. In other words, if I open notepad, and I'd like to write in it, how can i do it ? I know how to write into a text file and everything, so I think writing into another program should be something similar? (I hope so!)
public static void main(String[] args) { // TODO code application logic here try{ Runtime run = Runtime.getRuntime(); Process pro = run.exec("C:\\Program Files\\ ... notepad.exe"); // write this function should specify what to output in notepad writeToProgram(); System.exit(1); int retcode = pro.waitFor(); } catch(Exception e){ System.out.println(e); } } // found this code somewhere on the web
2 - Compiling a program : If I have a program (program1), that writes a Java program (program2) in netbeans, for example, and I want to compile and run what I wrote in program2, is there any function that allows us to "manipulate" another program using a Java program?
Thanks!