JTextArea does not update
I have a foo.exe program that generates output. I want to capture that output and put it in a
JTextArea. It works fine if I system.out it to the shell but does nothing when I put
it in the JTextArea. Is there any flush for JTextArea? Should I use something else to get this to work? I would appreciate any suggestion. Here is the piece of code.
JFrame myframe = new JFrame();
JTextArea textarea = new JTextArea("Beginning of output", 20, 20);
myframe.getContentPane().add(textarea,BorderLayout.EAST);
myframe.setVisible(true);
myframe.setSize(300,300);
try {
// Execute a command with an argument
String command = "foo.exe filename";
child = Runtime.getRuntime().exec(command);
InputStream in = child.getInputStream();
int c;
while ((c = in.read()) != -1) {
textarea.append(""+(char)c);
}
in.close();
} catch (IOException e) {
}

