title: How to fetch checked values from check boxes in jtable?
body: <p>I have JTable with name 'tableEarnings' it consist of 3 columns:</p>
  
  <ul>
  <li>check</li>
  <li>Earnings </li>
  <li>Description
  and  a </li>
  <li>jButton</li>
  </ul>
  
  <p>Every cell in 'check' column have a checkbox. I need to fetch checked values of 'Earnings' and 'Description' cell  from <code>JTable</code> and store it to a database when I click <code>jButton</code>
  please help me</p>
  
  <p>This my code for button listener:</p>
  
  <pre><code>private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
      //System.out.println("table"+tableEarnings.getModel().getRowCount());
      for (int i = 0; i &lt; tableEarnings.getModel().getRowCount()+1; i++) {    
          if ((Boolean) tableEarnings.getModel().getValueAt(i, 0)) {
             System.out.println("Value" + tableEarnings.getValueAt(i, 1));
             break;
          }
      }
  }
  </code></pre>