title: change jTable model in runtime
body: <p>I have a Java form application and I want to change a jTable's tableModel during runtime (on button click)
  I'm using the following code:</p>
  
  <pre><code>JButton btnNewButton = new JButton("Execute"); 
  btnNewButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
          try {
              TableModel newModel = dbHandler.executeQueryToTable(myQuery.getText());
              table.setModel(newModel);
              ((AbstractTableModel) newModel).fireTableDataChanged();
          } catch (SQLException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }
  
      }
  });
  </code></pre>
  
  <p>The problem is that the table isn't changing. I checked  that the model is ok but I think that the table needs to be updated somehow.
  Thank you very much!</p>