title: Jtable does not load
body: <p>I try to initiate a "JTable", I added all my elements through the form designer and initiated them in the main function of my GUI.</p>
  
  <p>The table is placed inside a "JScrollPanel" and used a "DefaultTableModel" to add the headers and rows.</p>
  
  <p>Whatever I did, I can't make the table to display headers or rows.<br>
  What am I missing here?</p>
  
  <pre><code>class Controls extends JPanel{
      private JButton compileButton;
      private JPanel controls;
      private JTabbedPane tabbedPane1;
  
      private JButton insertButton;
      private JTable insertedFilesTable;
      private JScrollPane insertedFilesViewport;
      private JPanel minify;
      private JFileChooser insertChooser;
  
      public Controls () {
          insertChooser = new JFileChooser();
  
          compileButton.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                  initCompile();
              }
          });
  
          insertButton.addActionListener(new ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                  buttonActionPerformed(e);
              }
          });
      }
  
      public void main () {
          JFrame frame = new JFrame("Controls");
  
          frame.setLayout(new SpringLayout());
          frame.setContentPane(new Controls().controls);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          DefaultTableModel model = new DefaultTableModel();
  
          model.addColumn("Files");
          model.addColumn("Status");
  
          insertedFilesTable = new JTable(model);
  
          insertedFilesViewport = new JScrollPane(insertedFilesTable);
          insertedFilesViewport.setViewportView(insertedFilesTable);
          insertedFilesTable.setFillsViewportHeight(true);
  
          String[] data = {"test","test"};
          model.addRow(data);
  
          frame.add(insertedFilesViewport);
  
          frame.setSize(500,500);
          frame.setVisible(true);
      }
  
      private void buttonActionPerformed(ActionEvent evt) {
          insertChooser.showSaveDialog(this);
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sZcOg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sZcOg.png" alt="My result"></a></p>