title: How to convert an existing JTable to a JTable result of a method?
body: <p>I have a JFrame generated by netbeans with a JTable1 in it. I have a method that accepts a JTable and returns a JTable2 with another stuff.</p>
  
  <p>I want to know how to make JTable1(JFrame) to JTable2(Method)?</p>
  
  <pre><code>public static JTable realTimeFilter(JTable table) {
  
      TableRowSorter&lt;TableModel&gt; rowSorter = new TableRowSorter&lt;&gt;(table.getModel());
      table.setRowSorter(rowSorter);
      table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
      table.getColumnModel().getColumn(0).setPreferredWidth(60);
      table.getColumnModel().getColumn(1).setPreferredWidth(60);
      table.getColumnModel().getColumn(2).setPreferredWidth(502);
      table.getColumnModel().getColumn(3).setPreferredWidth(130);
      table.getColumnModel().getColumn(4).setPreferredWidth(130);
      table.getColumnModel().getColumn(5).setPreferredWidth(130);
      table.getColumnModel().getColumn(6).setPreferredWidth(70);
      return table;
  }
  </code></pre>