Problem developing application which calls and displays result of executable

Hi All,

i am using ubuntu 10.04 LTS with C2D processor.

i want to develop a GUI application in Java using JSwing. This application will call executable present in the local hardisk of linux. The results of this exectuable (moses) must be displayed in TextArea of the application being built.

          String [] arg1={"echo",s, "|TMP=/tmp","/home/nakul/moses/mosesdecoder/trunk/moses-cmd/src/moses","-f /home/nakul/moses/mosesdecoder/trunk/scripts/training/moses-scripts/scripts-20110405-1055/training/corpus/tuning/mert/moses.ini","-v","2"};
 

         System.out.println(s);
         Process pro2=Runtime.getRuntime().exec(arg1);
         BufferedReader stdInput=new BufferedReader(new InputStreamReader(pro2.getInputStream()));
         //BufferedReader stdOut=new BufferedReader(new OutputStream(pro2.getOutputStream()));
       
        String s11="";
 

        while((s11=stdInput.readLine())!=null)
        {
            jTextArea1.append(s11);
        }
 

         }catch(Exception e){
 

             System.out.println(e);
         }
 

     }    
 

i have tried running the above code but it displys the whole paramters of moses executbale in text area..

Please tell how to solve this problem...

Thanks in advance,
n929