0

実行時間の長い perl スクリプトを実行する Swing アプリケーションを作成しています。プロセスがバックグラウンドで実行されている場合でも、実行の中間出力を同時に表示する必要があります。次のコードを使用すると、プロセスの完了時に出力が返されます。

BufferedReader stdInput = new BufferedReader(new 
                     InputStreamReader(p.getInputStream()));

                // read the output from the command
                while ((s = stdInput.readLine()) != null) {
                    System.out.println(s);
                }

出力を同時に取得するにはどうすればよいですか? 返された情報を表示するために Swingworker を使用しています。

4

1 に答える 1