title: JTable header not showing
body: <h2>JTable header not showing...</h2>
  
  <p>My JTable header wont show even if add it into a container like JScrollPane...tell me why is it happen and how can i fix it or debug it.. I search through internet and all they saying is add container to your jtable, i did but still my header are not showing.</p>
  
  <hr>
  
  <pre><code>public void table(){
  
  try{
  
          rs = stat.executeQuery("SELECT * FROM payments;");
  
          Vector&lt;String&gt; header = new Vector&lt;String&gt;();
  
          header.add("PAYMENT"); 
          header.add("AMOUNT");
          header.add("MODIFIER");
          header.add("DATE MODIFIED");
  
          Vector&lt;Vector&lt;Object&gt;&gt; data = new  Vector&lt;Vector&lt;Object&gt;&gt;();
  
          while(rs.next()) {
  
              Vector&lt;Object&gt; row = new Vector&lt;Object&gt;();
  
              row.add(rs.getString("description"));
              row.add(rs.getString("amount")); 
              row.add(rs.getString("remarks")); 
              row.add(rs.getString("date"));
  
  
              data.add(row);
  
          } // loop
  
          table = new JTable(data, header);
  
          JScrollPane scrollPane = new JScrollPane(table);
  
          panel.add(table);
          panel.add(table.getTableHeader());
          //panel.removeAll();
          //scroll.add(table);
          validate();
  
      }catch(Exception e){
          System.out.println("Error in table: "+e);
      }//try and catch
  
  }
  </code></pre>