title: ClassCastException using JTable?
body: <pre><code>renbor = tabla_proveedor.getSelectedRow();
  DefaultTableModel modelo = (DefaultTableModel) tabla_proveedor.getModel();
  modelo.removeRow(renbor);
  </code></pre>
  
  <p>That line of code gives me an error, it gives me...</p>
  
  <blockquote>
    <p>Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JTable$1 cannot be cast to javax.swing.table.DefaultTableModel</p>
  </blockquote>
  
  <p>How do I fix that? I need to remove a row from my table.</p>
  
  <p>This is where I instantiate tabla_proveedor</p>
  
  <pre><code>tabla_proveedor=new JTable(datos_proveedor,columna_proveedor)
  
      { 
          public boolean isCellEditable(int datos_proveedor, int columna_proveedor){
  
          return false;
          }
          public Component prepareRenderer(TableCellRenderer r, int datos_proveedor, int columna_proveedor)
          {
              Component c= super.prepareRenderer(r,datos_proveedor,columna_proveedor);
  
              return c;
          }
          };
  </code></pre>