title: setting the data of the next column in jtable in java
body: <p>Good day, guys. I would just like to ask, how can I set the value of the next column value? Here, I have the counter "counter" which adds the number of true boolean values in the sampleTable. What I want to do is to set the value of the data in the next column of the table, for the "total". the "total" data should be the counter value. What should I do about this?</p>
  
  <pre><code>private void tableTest(){
      int nRow = sampleTable.getRowCount();
      int nCol = sampleTable.getColumnCount();
      int counter = 0;
  
      Object[][] tableData = new Object[nRow][nCol];
      for (int i = 0 ; i &lt; nRow ; i++){
          for (int j = 3 ; j &lt; nCol ; j++){
              tableData[i][j] = sampleTable.getValueAt(i,j);
              System.out.println(tableData[i][j]);
              if(tableData[i][j] != null &amp;&amp; tableData[i][j].equals(true)){
                  counter++;
              }
          }
        /* if(nCol == 7){
                  sampleTable.setValueAt(i, 7, counter);
              }else{
                  tableData = new Object[nRow][nCol + 1];
                  sampleTable.setValueAt(i, 7, counter);
              }*/
         System.out.println(counter);
         sampleTable.setValueAt(i,7,counter);
         counter = 0;
      }
  }
  </code></pre>