W
Wizumwalt
I have a JPanel where, when the user clicks a button, it starts a
MyProcess which is a class that I extend from Thread. From within the
run() of class MyProcess, I have code like the following ...
// ---
ProcessBuilder pb = new ProcessBuilder("aprogram.exe", myInputFile);
pb.directory(new File("aDir"));
pb.redirectErrorStream(true);
process = pb.start();
in = new BufferedReader(new
InputStreamReader(process.getInputStream()));
out = new BufferedWriter(new
OutputStreamWriter(process.getOutputStream()));
// ---
My problem is that, I want to type keyboard input from within my JPanel
and have it fed into the stream so that aProgram.exe receives it as
input. In sum, I want to feed a Process object keyboard input from a
program that drops the thread and get it into the other program
(aprogram.exe).
Can anyone help out on how that should/might work? Any help much
appreciated.
MyProcess which is a class that I extend from Thread. From within the
run() of class MyProcess, I have code like the following ...
// ---
ProcessBuilder pb = new ProcessBuilder("aprogram.exe", myInputFile);
pb.directory(new File("aDir"));
pb.redirectErrorStream(true);
process = pb.start();
in = new BufferedReader(new
InputStreamReader(process.getInputStream()));
out = new BufferedWriter(new
OutputStreamWriter(process.getOutputStream()));
// ---
My problem is that, I want to type keyboard input from within my JPanel
and have it fed into the stream so that aProgram.exe receives it as
input. In sum, I want to feed a Process object keyboard input from a
program that drops the thread and get it into the other program
(aprogram.exe).
Can anyone help out on how that should/might work? Any help much
appreciated.