title: JTable Empty cell validation for the filled rows
body: <p>I am doing a project in java swing in which I have to use a JTable. 
  By default jtable can validate the inputs (float,int) by turning into red when wrong input is given.
  But I want to validate the empty cell left in the table at the time of save button click.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public boolean validCheck() {
  
      if (jTable.getCellEditor() != null) {
          jTable.getCellEditor().stopCellEditing();
      }
  
      for (int i = 0; i &lt; jTable3.getRowCount(); i++) {
          for (int j = 0; j &lt; jTable3.getColumnCount(); j++) {
               String val = jTable3.getValueAt(row, col).toString();
  
               if (val.trim().length() == 0) {
                  return false;(joptionpane.showmessagedialog(null,"field empty");)
               }
          }
      }
  
      return true;
  }
  </code></pre>
  
  <p>This code is checking all the rows in the table and displaying the field empty message. I need to check only filled rows(rows which have data) not all the rows in the jtable.</p>
  
  <p>Any suggestions would be helpful.</p>