title: Process, thread closing application
body: <p>i have a little application who are displayed in the system tray.</p>
  
  <p>From this application i start a command,  i run another java program and i get it inputStream and display it in a textArea.</p>
  
  <pre><code>final Process process = Runtime.getRuntime().exec( runCommand );
  
  input = new LoggingThread( process.getInputStream() );
  error = new LoggingThread( process.getErrorStream() );
  
  input.start();
  error.start();
  
  In loggingThread
  public void run()
  {
  
      while ( running )
      {
          try
          {
              BufferedReader reader = new BufferedReader( new InputStreamReader( inputStream ) );
              String line = "";
              try
              {
                  while ( ( line = reader.readLine() ) != null &amp;&amp; running )
                  {
                      JTextAreaAppender.getTextArea().append( line );
                      JTextAreaAppender.getTextArea().append( System.getProperty( "line.separator" ) );
                  }
  
              }
              finally
              {
                  reader.close();
              }
          }
          catch ( IOException ioe )
          {
              ioe.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>when i quit application i do</p>
  
  <pre><code>input.setRunning(false);
  error.setRunning(false);
  </code></pre>
  
  <p>i do also a dispose on the TrayIcon class</p>
  
  <p>in the task manager, i continue to see two thread for the application, and one for Process</p>
  
  <p>if i remove process, thread... application is closing correctly</p>
  
  <p>if i put </p>
  
  <pre><code>proc.destroy();
  </code></pre>
  
  <p>after setRunning, closing application don't work at all, TrayIcon continue to display</p>
  
  <p>any idea?</p>