Rutime.getRuntime().exec(text)
Here is the deal. I have the code shown below. Works great.Gets the String tf.getText() and executes it. The problem is that the command (tf.getText()) is a command that may take a while (ie. 12 seconds). I want to System.out.println("Running...") before the command starts getting executed and a System.out.println("Execution Complete") after it has finished. I thought if I put the running println at SPOT A (see code) and the finished println at SPOT B it would do just that, but it doesnt do that, and now that I think about it, it makes sense and I understand why. Java is not waiting for that to finish, it calls on that command to execute and then goes on with its business. But I still want the println's. What do I do?
if (e.getSource() == run) {
try {
// SPOT A
Runtime.getRuntime().exec(tf.getText());
// SPOT B
}
catch (Exception ex) { }
}
thanks in advance.

