title: how to make a thread typing in jtextarea?
body: <p>hello i'm beginner in java language ... so 
  my problem is that i want to make a thread typing in jtext area  but i have no idea how to do that </p>
  
  <p>i use netbines IDE</p>
  
  <p>this is my code:</p>
  
  <p>class md2:</p>
  
  <pre><code>import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class md2 implements Runnable{
  
      public void run(){  
          int i=0;
  while(true){
      System.out.println("méthode 2 : "+i++); // that what i want to typing in the jtextarea
  
              try {
                  Thread.sleep(200);
              } catch (InterruptedException ex) {
                  Logger.getLogger(md2.class.getName()).log(Level.SEVERE, null, ex);
              }
  }  
  
  }} 
  </code></pre>
  
  <p>and this is my jframe :</p>
  
  <pre><code>    public class tp3 extends javax.swing.JFrame {
  
  
          public tp3() {
  
              initComponents();
          }
      md2 m1=new md2(); 
  
      Thread cp3 =new Thread(m1); 
  
  
  
          @SuppressWarnings("unchecked")
          // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;                          
          private void initComponents() {
     tx = new javax.swing.JTextArea(); // this is where i want to typing
     tx.setColumns(20);
     tx.setRows(5);
          }// &lt;/editor-fold&gt;                        
  
          private void sMouseClicked(java.awt.event.MouseEvent evt) {                               
              cp3.start();  // button to start the thread
          }                              
  </code></pre>