title: Display CMD output in my GUI (java)
body: <p>How might I get the output from a CMD process to display in my GUI?  This is the code I'm using to run the process:</p>
  
  <pre><code>try {
      String line;
      Process p = Runtime.getRuntime().exec("cmd /c \"e:\\folder\\someCommands.cmd\"");
      BufferedReader input =
              new BufferedReader(new InputStreamReader(p.getInputStream()));
      while ((line = input.readLine()) != null) {
          System.out.println(line);
      }
      input.close();
  } catch (Exception err) {
      err.printStackTrace();
  }
  </code></pre>
  
  <p>I've tried doing this:</p>
  
  <pre><code>jLabel1.setText(line);
  </code></pre>
  
  <p>...but the GUI is completely locked up while the process is running, so nothing updates until the very end, which isn't very useful.  Other than that the CMD works fine.  I just want to display the output in real-time.</p>