title: How to get value of Last cell in JTable?
body: <p>I have a query ... code is running fine, but am not able to get value of last cell of last row and last column. Below is the code... pls guide</p>
  
  <p>with this code am adding rows dynamically to JTable :
      if(e.getSource()==addb)
          {</p>
  
  <pre><code>        model.addRow(new Object[3]);
          repaint();
  
      }
  </code></pre>
  
  <p>Below is the code for getting values from JTable row wise and later on instead of System.out.println() am going to send data to database...</p>
  
  <pre><code>if(e.getSource()==submit)
      {
          int j = table.getRowCount();
          for(int row=1;row&lt;j;row++)
          {
              for(int column=0;column&lt;3;column++)
              {
                  System.out.println("row  "+row+"   Column is  "+column);                    
                  System.out.println(model.getValueAt(row, column));
              }
          }
  
      }
  </code></pre>