title: JTable not visible when adding with JScrollPane
body: <p>i am working on a gui based project and i need to add a jtable in a jpanel.But i am not getting why the table is not being displayed when adding with a scrollpane.Also when adding without scrollpane,the table header is not displayed.
  Thanks for any help...
  Following is the code i am using..</p>
  
  <pre><code>import javax.swing.*;
  import javax.swing.table.*;
  import java.sql.*;
  import java.awt.*;
  import java.awt.event.*;
  
  public class FrmAddEditDN extends JDialog{
      JButton JBUpdate = new JButton(new ImageIcon("images/save.png"));
      JButton JBReset = new JButton("Reset",new ImageIcon("images/reset.png"));
      JButton JBCancel = new JButton("Cancel",new ImageIcon("images/cancel.png"));
  
      JLabel JLPic1 = new JLabel();
      JLabel JLBanner = new JLabel("Please fill-up all the required fields.");
  
  public FrmAddEditDN(boolean ADD_STATE,JFrame OwnerForm,Connection srcCN,String srcSQL){
          super(OwnerForm,true);
          cnAEDN = srcCN;
          ADDING_STATE = ADD_STATE;
          JPanel JPContainer = new JPanel();
          JPContainer.setLayout(null);
                  String[] columnNames = {
                      "Sr No","Invoice No","Invoice Date","Consignee","Description","Basic Amount","Invoice Amount","Payment Received",
                  "EFT Date","Payment Earlier Received","Comm. @ %","Comm.Claim @ %","Comm. Received","Date","Bank","Remarks"};
                  String[][] data = {
                      {"","","","","","","","","","","","","","","",""}
     };
                  DefaultTableModel DTModel = new DefaultTableModel(data,columnNames);
                  JTable table = new JTable(5,16);
                  table.setBounds(15,295,screen.width-40,150);
                  table.setRowHeight(30);
                  table.setForeground(Color.black);
                  table.setBackground(Color.white);
                  JTableHeader header = table.getTableHeader();
                  header.setForeground(Color.red);
                  header.setBackground(Color.green);
                  table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
                  table.getColumnModel().getColumn(0).setPreferredWidth(2);
                  table.getColumnModel().getColumn(1).setPreferredWidth(50);
                  JScrollPane tableContainer = new JScrollPane();
                  tableContainer.setViewportView(table);
  
                  JPContainer.add(tableContainer);
  
                  getContentPane().add(JPContainer);
          setSize(screen.width-5,screen.height-45);
          setResizable(false);
          setLocation(0,0);
      }
  }
  </code></pre>