import java.awt.*; import javax.swing.*; public class CrpcDisplay implements Runnable { private JTextField status; private JTextArea resultText; private JScrollPane sp; private String command; private boolean debug; private Thread rjThread, sfThread, rfThread, meThread; public CrpcDisplay(JTextField status, JTextArea resultText, JScrollPane sp, String file-name, boolean debug) { this.status = status; this.resultText = resultText; this.sp = sp; this.command = command; this.debug = debug; if(debug) System.out.println("CrpcDisplay constructor completed"); } public void run(){ /* then run the job */ status.setText("running..."); crpcSend rj = new crpcSend(file-name, resultText, sp, debug); rjThread = new Thread(rj); rjThread.start(); MonitorExecution me = new MonitorExecution(rjThread,status,debug); meThread = new Thread(me); meThread.start(); try { meThread.join(); } catch (Exception e) {System.out.println("run "+e);} } public synchronized void waitFor(long howLong){ try { wait(howLong); } catch (Exception e) { System.out.println(e);} } }