title: JTable returning JTable when calling getModel()
body: <p>My JTable is declared as so:</p>
  
  <pre><code>String[] cols = {"Name","Location"};
  String[][] data = new String[][] {{"Name","Location"}};
  JTable table = new JTable(data, cols);
  </code></pre>
  
  <p>So i came across a problem when trying to update my <code>JTable</code>'s data... I'm suppose to be adding a new row to the table. Here is my code for that:</p>
  
  <pre><code>data = new String[][] {{"Name","Location"}{"Name1","Location1"}};
  DefaultTableModel dm = (DefaultTableModel)(table.getModel());
  dm.fireTableDataChanged();
  </code></pre>
  
  <p>For some reason i get an error on the Line:</p>
  
  <pre><code>DefaultTableModel dm = (DefaultTableModel)(table.getModel());
  </code></pre>
  
  <p>The error shown is...</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JTable$1 cannot be cast to javax.swing.table.DefaultTableModel
  at client.pages.ClientPage.update(ClientPage.java:171)
  </code></pre>
  
  <p>Line 171 of my ClientPage.java is the above line of code that i said the error is on. </p>
  
  <p>Anyone know why its doing this? </p>
  
  <pre><code>table.getModel(); //Suppose to return TabelModel not JTable
  </code></pre>