title: Adding a component to jPanel java
body: <p>i'm trying to add a jtable component to my jPanel but i am unable to see it. What am i doing wrong?. </p>
  
  <pre><code>table gui = new table(data,colum); 
  mainPanel.add(gui.table);
  
  class table extends JFrame
  {
      public JTable table; 
  
      public table(Vector data, Vector colum)
      {
          setLayout(new FlowLayout()); 
          table = new JTable(data,colum);
          table.setPreferredScrollableViewportSize(new Dimension(900,10));
          table.setFillsViewportHeight(true);
          JScrollPane scrollPane = new JScrollPane(table);
          add(scrollPane); 
      }
  
  }
  </code></pre>