catch cmd output and include it on list java
<p>i try to do some cmd command in java, my script:</p>

<pre><code>public void test(){
try{

Runtime rt=Runtime.getRuntime();
Process p = rt.exec("cmd /c "+"adb devices");

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

while((line=input.readLine())!=null){

    System.out.print(line);

}

}catch(Exception e){
    System.out.println("process failed");
    }
} 
</code></pre>

<p>and the output result:</p>

<pre><code>run:
List of devices attached 
0160880B0401F006    device
</code></pre>

<p>how can i catch the part of that result: "0160880B0401F006" and put into a list on my gui?</p>

<p>thanks before</p>
