title: Increase row count in a JTable
body: <p>I'm developing an address book for my classmates but I'm having a problem with a <code>JTable</code>. Here you can see a preview of the program, I'm using NetBeans [<a href="https://i.imgur.com/j2ZMXoV.png" rel="nofollow noreferrer">click</a>]. If you click <code>Add to the Address Book</code>, the program adds a new row in that table and fills its cells with the data located in text fields below. I'm using the following code but the row count doesn't increase.</p>
  
  <p><img src="https://i.stack.imgur.com/gd3Oz.png" alt="GUI as is"></p>
  
  <pre><code> private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
          int h;
          DefaultTableModel model = new DefaultTableModel();
          h=jTable1.getRowCount()+1;
          model.setRowCount(h);
          jTable1.setValueAt(jTextField2.getText(), h, 1);
          jTable1.setValueAt(jTextField3.getText(), h, 2); 
          //I'll use more setValueAt() because I must fill all the cells
      } 
  </code></pre>
  
  <p>Could you give me some advice as to how to fix this problem? </p>