title: Using tablemodel in EDT which generated by SwingWorker
body: <p>I have Swingworker for create table model for update the jTable when program is launched. But i dont know how can i call this model from EDT and apply this model to my jtable ?</p>
  
  <p>Here my Swingworker code;</p>
  
  <pre><code>public class FillTable extends SwingWorker&lt;DefaultTableModel, DefaultTableModel&gt; {
      private final DefaultTableModel model;
      public FillTable(DefaultTableModel model) {
       this.model = model;
      }
  
     @Override
   protected DefaultTableModel doInBackground() throws Exception {
          ResultSet rsaccounts;
          Statement stmt;
          String queryaccounts = "select NAME from acc (nolock)\n" + "order by Name";
  
          Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
          String connectionUrl = "jdbc:sqlserver://192.100.100.23;" + "databaseName=Dbacc;" + "user=" + "sa" + ";" + "password=" + "sapassword!" + ";"; 
          Connection con = DriverManager.getConnection(connectionUrl);
          stmt = con.createStatement();
          rsaccounts = stmt.executeQuery(queryaccounts);
          ResultSetMetaData rsmd = rsaccounts.getMetaData();
  
  
          Vector&lt;String&gt; columnNames = new Vector&lt;String&gt;();
          columnNames.add(rsmd.getColumnName(1)); 
          System.out.println(columnNames);
          int columnCount = rsmd.getColumnCount();
  
          Vector&lt;Vector&lt;Object&gt;&gt; data = new Vector&lt;Vector&lt;Object&gt;&gt;();
  
         while (rsaccounts.next()) {
              Vector&lt;Object&gt; vector = new Vector&lt;Object&gt;();
              for (int columnIndex = 1; columnIndex &lt;= columnCount; columnIndex++) {
              vector.add(rsaccounts.getObject(columnIndex));
              }
              data.add(vector);
         }
  
          rsaccounts.close();
          stmt.close();
          model = new DefaultTableModel(data, columnNames);
          return model;
      }
  
  
    protected void done() {
      try {
          TableModel model = get();
      } catch (InterruptedException | ExecutionException ex) {
          ex.printStackTrace();
      }
    }
  
  }
  </code></pre>
  
  <p>Below method return error;
  Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Cannot set a null TableModel</p>
  
  <pre><code>private DefaultTableModel model1;
  
  FillTable fff = new FillTable(model1);
          fff.execute();
          model1 = fff.model;
  
          jTable3.setModel(model1);
  </code></pre>