title: GridBagConstraints not placing components at the written coordinates
body: <p>please have a look at this image below:
  <img src="https://i.stack.imgur.com/KuVI8.jpg" alt="enter image description here"></p>
  
  <p>As you can see <strong>"Add Program" , "Delete Program" , "Add New Unit" and "Delete Unit"</strong> are overlapping the buttons that come before.</p>
  
  <p>The buttons that come before are placed at (0,9) and the stated buttons are at (0,10).</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  
  public class guiStyle extends JFrame
  {       
      Container cp = getContentPane();
  
      public guiStyle()
      {
          super( "Student Study Planner 2014" );
          makeFrame2();
  
          pack();
          setVisible(true);
          setResizable(true);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
      }
  
  
      public void makeFrame2()
      {                                
          setPreferredSize( new Dimension ( 1000 , 600 ) );
  
          cp.setLayout( new GridBagLayout() );
          GridBagConstraints gbc = new GridBagConstraints();
          gbc.insets = new Insets ( 5 , 5 , 5 , 5 );
  
          JLabel lblProgram , lblUnit , lblDetails;        
          JList programList , unitList;
          JTextArea pl = new JTextArea("ProgramList" , 20 , 20);
          JTextArea ul = new JTextArea("UnitList" , 20 , 20);
          JScrollPane sp , sp2;
  
  
          JButton btnAddProgram , btnDelProgram;
          JButton btnAddUnit2Prog,btnDelUnitFromProgram;
  
          JButton btnAddUnit, btnDelUnit;
          JButton btnAddPrere,btnDelPrere;
          JButton btnAddCoreq,btnDelCoreq;
  
          lblProgram = new JLabel ( "Program" );   
          lblUnit = new JLabel ( "Unit" );
  
          programList = new JList();        
  
          unitList = new JList();        
  
          btnAddProgram = new JButton ( "Add Program" );
          btnDelProgram = new JButton ( "Delete Program" );
          btnAddUnit2Prog=new JButton ( "Add Unit To Program" );
          btnDelUnitFromProgram=new JButton("Delete Unit From Program");
  
          btnAddUnit = new JButton ("Add New Unit");
          btnDelUnit = new JButton ("Delete Unit");
          btnAddPrere = new JButton("Add Prerequisite");
          btnDelPrere = new JButton("Delete Prerequisite");
          btnAddCoreq = new JButton("Add Corequisite");
          btnDelCoreq = new JButton("Delete Corequisite");
  
          gbc.gridx = 0;
          gbc.gridy = 0;
          gbc.gridwidth = 2 ;
          gbc.fill = GridBagConstraints.HORIZONTAL;
          cp.add ( lblProgram , gbc );
  
          gbc.gridx = 0;
          gbc.gridy = 2;
          gbc.gridwidth = 2;
          gbc.gridheight= 7;
          gbc.fill = GridBagConstraints.HORIZONTAL;
          gbc.fill = GridBagConstraints.VERTICAL;
          cp.add ( pl , gbc );
  
          JPanel p1 = new JPanel();
          p1.add ( btnAddProgram );
          p1.add ( btnDelProgram );
          gbc.gridx = 0;
          gbc.gridy = 9;
          cp.add ( p1 , gbc );
  
  
          JPanel p2 = new JPanel();
          p2.add ( btnAddUnit2Prog );
          p2.add ( btnDelUnitFromProgram );
          gbc.gridx = 0;
          gbc.gridy = 10;
          cp.add ( p2 , gbc );
  
  
         //Unit
          gbc.gridx = 2;
          gbc.gridy = 0;
          gbc.gridwidth = 2 ;
          gbc.fill = GridBagConstraints.HORIZONTAL;
          cp.add ( lblUnit , gbc );       
  
          gbc.gridx = 2;
          gbc.gridy = 2;
          gbc.gridwidth = 2;
          gbc.gridheight= 7;
          gbc.fill = GridBagConstraints.HORIZONTAL;
          gbc.fill = GridBagConstraints.VERTICAL;
          cp.add ( ul , gbc );        
  
          JPanel p3 = new JPanel();
          p3.add ( btnAddUnit );
          p3.add ( btnDelUnit );
          gbc.gridx = 2;
          gbc.gridy = 9;
          cp.add ( p3 , gbc );
  
          JPanel p4 = new JPanel();
          p4.add ( btnAddPrere );
          p4.add ( btnDelPrere );
          gbc.gridx = 2;
          gbc.gridy = 10;
          cp.add ( p4 , gbc );
  
      }
  
  }
  </code></pre>
  
  <p>What could have cause this misdisplay?</p>