title: Adding a Row in a Jtable with AbstractTableModel
body: <p>I'm trying to add a row into the <code>Jtable</code> that extends <code>AbstractTableModel</code> as the following code shows:</p>
  
  <pre><code>class AbstractTable extends AbstractTableModel
  {
      String[] columNames = {"name", "cc", "age", "phone", "date", "amoun"};      
      Object[][] dataRow = {{"harry", "1234","21","23594","13/3/2","3000"} };
  
      @Override
      public int getColumnCount()
      {
          return columNames.length;
      }
  
      @Override
      public int getRowCount()
      {
          return dataRow.length;
      }
  
      public String getColumnName(int col)
      {
          return columNames[col];//cast from object to string.            
      }
  
      @Override
      public Object getValueAt(int row, int col)
      {
          return dataRow[row][col];
      }
  
      public void setValueAt(Object value, int row, int col)
      {
          dataRow[row][col] = value;
          fireTableCellUpdated(row, col);
      }
  }
  </code></pre>
  
  <p>Here I implement a button that tries to add a row into the <code>Jtable</code> model once is pressed, but it is not working and throwing an exception: </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: AbstractTable cannot be cast to
    javax.swing.table.DefaultTableModel</p>
  </blockquote>
  
  <pre><code>public void actionPerformed(ActionEvent e)
  {           
      if(e.getActionCommand().equals("add client"))
      {
          Object[] dataList = {"", "", "", "", "", ""};               
  
          AbstractTableModel defaut = (AbstractTableModel) table.getModel();
  
          ((DefaultTableModel) defaut).addRow(dataList);
  
          labelStatus.setText("Cliente Agregado.");
      }
  </code></pre>
  
  <p>How can I add a row in this code properly ? </p>