title: adding data to JTable when working with netbeans
body: <p>How can i add data to <code>JTable</code> while working with netbeans. Netbeans in it's back code does like this :</p>
  
  <pre><code>jTable1 = new javax.swing.JTable();
  jTable1.setModel(new javax.swing.table.DefaultTableModel(
          new Object [][] {
              {null, null},
              {null, null},
              {null, null},
              {null, null}
          },
          new String [] {
              "Name", "Branch"
          }
      ) {
          boolean[] canEdit = new boolean [] {
              false, false
          };
  
          public boolean isCellEditable(int rowIndex, int columnIndex) {
              return canEdit [columnIndex];
          }
      }); // THIS IS THE SNIPPET GENERATED BY NETBEANS
      //( I have already created a table using the drag and drop fetaure of netbeans and this is the back snippet generated)
  </code></pre>
  
  <p>The 2-D object array and String array have local access , so i can't use to fill it when i want to in the middle of the program. <em>(in some function)</em></p>
  
  <p><img src="https://i.stack.imgur.com/A5fj9.jpg" alt="enter image description here"> </p>
  
  <p>like in the above table i will be adding name and branch while in some function.But how can i do this ?</p>
  
  <p>Can anyone please tell a way so that i can add data to JTable ?</p>