title: JPanel not showing when added to JFrame
body: <p>I am creating a GUI in java. Currently i have an empty JFrame and am trying to add a JPanel to it. The JPanel contains buttons, text etc. However none of this is being displayed. My code is as follows:</p>
  <pre><code>import java.awt.*;
  import java.awt.event.*;
  
  import javax.swing.*;
  
  
  public class memoDisplayUI { 
  
  
  JFrame frame = new JFrame();
  JPanel panel = new JPanel();
  JTextArea jTextBox = new JTextArea();
  JScrollPane scroll = new JScrollPane();
  
  /**
   * Launch the application.
   */
  public static void main(String[] args) {
      EventQueue.invokeLater(new Runnable() {
          public void run() {
              try {
                  memoDisplayUI frame = new memoDisplayUI();
                  frame.frame.setVisible(true);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      });
  }
  
  /**
   * Create the application.
   */
  public memoDisplayUI() {
      initialize();
  }
  
  /**
   * Initialize the contents of the frame.
   */
  private void initialize() {
      
      frame.getContentPane().setBackground(new Color(255, 255, 255));
      frame.getContentPane().setLayout(null);
      frame.setBounds(100, 100, 270, 400);
      frame.setUndecorated(true); //REMOVES MENU BAR
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      
      JLabel lblMemos = new JLabel(&quot;MEMOS&quot;);
      lblMemos.setForeground(new Color(100, 149, 237));
      lblMemos.setFont(new Font(&quot;Moire&quot;, Font.BOLD, 30));
      lblMemos.setBounds(16, 16, 234, 37);
      panel.add(lblMemos);
      
      JButton button = new JButton(&quot;&quot;);
      button.setBackground(new Color(100, 149, 237));
      button.setBounds(7, 350, 40, 40);
      panel.add(button);
      button.setIcon(new ImageIcon(&quot;back.png&quot;));
      
      JButton button_1 = new JButton(&quot;&quot;);
      button_1.setBackground(new Color(100, 149, 237));
      button_1.setBounds(113, 350, 40, 40);
      panel.add(button_1);
      button_1.setIcon(new ImageIcon(&quot;Edit.png&quot;));
      
      JButton button_2 = new JButton(&quot;&quot;);
      button_2.setBackground(new Color(100, 149, 237));
      button_2.setBounds(220, 350, 40, 40);
      panel.add(button_2);
      button_2.setIcon(new ImageIcon(&quot;memo.png&quot;));
      
      JButton btnExit = new JButton(&quot;&quot;);
      btnExit.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
              System.exit(0);
          }
      });
      btnExit.setBorder(null);
      btnExit.setIcon(new ImageIcon(&quot;Exit.jpg&quot;));
      btnExit.setBounds(216, 19, 40, 40);
      panel.add(btnExit);
      
      jTextBox = new JTextArea();
      scroll.setViewportView(jTextBox); // add scroll panel
      jTextBox.setTabSize(4);
      jTextBox.setLineWrap(true);
      jTextBox.setBackground(new Color(192, 192, 192));
      jTextBox.setBounds(8, 60, 255, 286);
      panel.add(jTextBox);
      
      frame.getContentPane().add(panel);
  }
  }
  </code></pre>
  <p>Could someone please advise as to why this is?</p>
  <p>Thanks very much :)</p>
  <h2>Edit</h2>
  <p>From a few tweaks to the code, it appears this is the desired layout (in a non-resizable GUI).</p>
  <p><img src="https://i.stack.imgur.com/Pd5ch.png" alt="Memos GUI" /></p>