title: JTable is not displayed in Jframe
body: <p>I can't manage to display the JTable in a JFrame. Actually I have extracted the data from an ArrayList and filled the JTable row by row. I have checked that the JTable is filled, the number of rows is equal to the rows in the original ArrayList. Yet running the function shows a blank GUI. I really do not see the problem in my code:</p>
  
  <pre><code>public Graphicalinterface4() {
      //super (new GridLayout(1,0));
  
      //panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
  
      getdata2 in=new getdata2();
      try {
          ArrayList&lt;Piece&gt; test=in.getList();
          ArrayList&lt;Piece&gt; classified=in.classify(test);
          JTable table=getlocaltable(classified); 
          table.setFillsViewportHeight(true);
          JScrollPane scrPane=new JScrollPane(table);
          //scrPane.setSize(800,690);
          //scrPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          this.add(scrPane);
  
          //scrPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          this.pack();
          this.setVisible(true);
  
      }
      catch (IOException ex) {
          ex.printStackTrace();
      }
  
  
  }
  
  
  public JTable getlocaltable(ArrayList&lt;Piece&gt; in) {
  
  
      //new Object[]{"Type","Company","reference","description","price","To order"}));
  
      //DefaultListModel&lt;Piece&gt; testlst=new DefaultListModel&lt;Piece&gt;();
      int sz=in.size();
      String[] columns=new String[] {
              "Type","Company","reference","description","price","To order"
      };
      DefaultTableModel model = new DefaultTableModel();
      //JTable table=new JTable(null, in.toArray());
      for (int i=0;i&lt;sz;i++) {
          Piece p=in.get(i);
  
          String type=p.gettype();
          String company=p.getasc();
          String reference=p.getref();
          String description=p.getdesc();
          String price=p.getprice();
          String image=p.getimage();
          System.out.println(type);
          //DefaultTableModel model=(DefaultTableModel) table.getModel();
          model.addRow(new Object[]{type,company,reference,description,price,Integer.toString(0)});
      }
      JTable table=new JTable(model);
      System.out.println(table.getRowCount());
      return table;
  }
  
  
  static Graphicalinterface4 ssp;
  
  public static void main(String[] args) throws IOException {
      SwingUtilities.invokeLater(new Runnable() {
          public void run() {ssp=new Graphicalinterface4();}
      });
  }
  </code></pre>