title: Why does my JTable over take my other JComponent
body: <p>I've been trying to sort this out for a while now, I have checked the docs (if you notice the table code is from there), and I just can't quite figure it out.  Am I using the wrong containers or do I need to dimension it?  If so, how?</p>
  
  <pre><code>import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  
  public class Invest extends JFrame {
  
      public static void main(String[] args) {
          demolayout frame = new demolayout();
          frame.setTitle("Financial Calculator");
  
          JPanel toppanel = new JPanel(new GridLayout(3, 3, 2, 2));
          frame.add(toppanel, BorderLayout.NORTH);
  
          String[] columnNames = {"Entry", "Year", "Year", "Year", "Year"};
  
          Object[][] data = {{"Period Ending:", "2011", "Snowboarding", new Integer(5), new Boolean(false)},
              {"Values in Millions of $", "12-31", "Rowing", new Integer(3), new Boolean(true)},
              {"Revenue:", "46,542", "Knitting", new Integer(2), new Boolean(false)},
              {"Revenue Other:", "-", "Speed reading", new Integer(20), new Boolean(true)},
              {"Total Revenue:", "46,542", "Speed reading", new Integer(20), new Boolean(true)},
              {"Cost of Revenue:", "18,216", "Speed reading", new Integer(20), new Boolean(true)},
              {"Gross Profit:", "28,326", "Speed reading", new Integer(20), new Boolean(true)},
              {"Selling Gen. Admin Expenses:", "12,111", "Speed reading", new Integer(20), new Boolean(true)},
              {"Research &amp; Development:", "-", "Speed reading", new Integer(20), new Boolean(true)},
              {"Depreciation/Amortization:", "-", "Speed reading", new Integer(20), new Boolean(true)},
              {"Total Operating Expense:", "154", "Speed reading", new Integer(20), new Boolean(true)},
              {"Operating Income:", "35,810", "Speed reading", new Integer(20), new Boolean(true)},
              {"Interest Income (Exp.), Net NonOp:", "10,732", "Speed reading", new Integer(20), new Boolean(true)},
              {"Interest/Invest Inc. Non-Operating:", "White", "Speed reading", new Integer(20), new Boolean(true)},
              {"Interest Inc. Net Non-Operating:", "White", "Speed reading", new Integer(20), new Boolean(true)},
              {"Gain/Loss on Sale of Assets:", "White", "Speed reading", new Integer(20), new Boolean(true)},
              {"Other, Net:", "White", "Speed reading", new Integer(20), new Boolean(true)},
              {"Net Income Before Taxes:", "White", "Speed reading", new Integer(20), new Boolean(true)},
              {"Income Tax - Total:", "White", "Speed reading", new Integer(20), new Boolean(true)},
              {"Minority Interest:", "Brown", "Pool", new Integer(10), new Boolean(false)},
              {"Equity In Affiliates:", "Brown", "Pool", new Integer(10), new Boolean(false)},
              {"Accounting Change:", "Brown", "Pool", new Integer(10), new Boolean(false)},
              {"Discontinued Operations:", "Brown", "Pool", new Integer(10), new Boolean(false)},
              {"Extraordinary Items:", "Brown", "Pool", new Integer(10), new Boolean(false)},
              {"Net Income:", "Brown", "Pool", new Integer(10), new Boolean(false)}};
  
          JTable table = new JTable(data, columnNames);
          JScrollPane scrollPane = new JScrollPane(table);
          toppanel.add(scrollPane);
  
          JPanel bottompanel = new JPanel(new FlowLayout());
          bottompanel.setBackground(new Color(150, 150, 150));
  
          JButton compute = new JButton("Compute Ratios");
          bottompanel.add(compute);
          frame.add(bottompanel, BorderLayout.SOUTH);
  
  
          frame.setSize(800, 500);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
      }
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/jrhE7.png" alt="enter image description here"></p>