title: Jtable to TextArea in java
body: <p>I need some help understanding why the ArrayList is not being populated,</p>
  
  <p>I am trying to pass information Stored in a jTable that is on a JFrame to a JTextArea taht is on another JFrame, i curently have the following code but for some reason the information is not being passed, it stays Empty</p>
  
  <p>I dont want Anyone to do my HW for me i just need to be pointed in the right direction, </p>
  
  <p>here is the Code i did so far.</p>
  
  <pre><code>     public ArrayList&lt;String&gt; extractTableInfo() {
  
      DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
  
      int nRow = model.getRowCount(), nCol = model.getColumnCount();
  
  
      ArrayList&lt;String&gt; extractedInfo = new ArrayList&lt;String&gt;();
  
      String rowInfo = "";
  
      for (int i = 0; i &lt; nRow; i++) {
          for (int j = 0; j &lt; nCol; j++) {
              rowInfo = rowInfo + (String) model.getValueAt(i, j);
          }
          extractedInfo.add(rowInfo);
      }
  
      return extractedInfo;
  }
  </code></pre>
  
  <p>Thats in the First JFrame and in the second JFrame on button Click i have </p>
  
  <pre><code>     private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
  
  
      Generate_Teams gt = new Generate_Teams();
  
       ArrayList&lt;String&gt; TableInformation = new ArrayList&lt;String&gt;();
  
       for(int i =0; i &lt; gt.extractTableInfo().size(); i++){         
       TableInformation.add(gt.extractTableInfo().get(i));
       }
  
  
  
      for (int i = 0; i &lt; TableInformation.size(); i++) {
          jTextArea1.append(TableInformation.get(i));
      }
  
  
  }                                        
  </code></pre>
  
  <p>i would apriciate any help you can give.</p>
  
  <p>Thx in advance.....</p>
  
  <p>Fix....</p>
  
  <p>Thx for your help fixed it like this,</p>
  
  <pre><code> Edit ed = new Edit(extractTableInfo());
  
   ed.setVisible(true);
  </code></pre>
  
  <p>that is in the First Frame and in the second frame i did this</p>
  
  <pre><code>private ArrayList&lt;String&gt; infogot = new ArrayList&lt;String&gt;();
  
    public Edit(ArrayList&lt;String&gt; getinfo)
   { 
     initComponents();
     this.infogot = getinfo;
  
   }
  
  
     for (int i = 0; i &lt; infogot.size(); i++) {
        jTextArea1.append(String.valueOf(infogot.get(i)));
      }
  </code></pre>
  
  <p>And it worked like this</p>