StringBuffer result = new StringBuffer(); try{ Process p=Runtime.getRuntime().exec("ping "+ tf1.getText()); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream(),"Cp850")); for ( String s; (s = in.readLine()) != null; ){ result.append(s+"\n"); } }catch(Exception ex){ } t1.setText(result.toString());