title: JTextField and JComboBox make my JPanel disappear from the screen
body: <p>whenever I uncomment my JTextField or JComboBox they make all my swing elements disappear, I've tried resizing them and manipulating them in any way but I have no clue as to why the stuff is disappearing. They weren't on a previous program I wrote and they're wrote the exact same way. They elements even disappear if the two objects aren't even added to the panel.</p>
  <p><img src="https://i.stack.imgur.com/irLKZ.png" alt="" /></p>
  <p><img src="https://i.stack.imgur.com/0uBxU.png" alt="" /></p>
  <p>Here's the code I have for my program. I don't really want to separate the 2 panels into their own Classes.</p>
  <pre><code>import java.awt.*;
  import javax.swing.*;
  
  public class Main {
      
      public static void main(String[] args) {
          // Create window
          JFrame window = new Window();
          String[] optionsToChoose = {&quot;Car Parts&quot;, &quot;Fast Food&quot;, &quot;Groceries&quot;, &quot;Clothing&quot;, &quot;Gas&quot;, &quot;Store&quot;, &quot;Entertainment&quot;};
          
          // Create first screen
          JPanel startPanel = new JPanel();
          startPanel.setLayout(null);
          startPanel.setBounds(230, 230, 500, 250);
          startPanel.setBackground(new Color(177, 177, 177));
          
          JLabel header = new JLabel(&quot;CHOOSE AN ACTION&quot;);
          header.setForeground(Color.white);
          header.setFont(new Font(&quot;Verdana&quot;, Font.BOLD, 20));
          header.setHorizontalAlignment(JLabel.CENTER);
          header.setBounds(0, -25, 500, 150);
          
          JButton add = new JButton(&quot;ADD&quot;);
          add.setBackground(new Color(0, 109, 91));
          add.setForeground(Color.white);
          add.setFont(new Font(&quot;Verdana&quot;, Font.BOLD, 15));
          add.setBounds(90, 125, 150, 50);
          
          JButton view = new JButton(&quot;VIEW REPORT&quot;);
          view.setBackground(new Color(167, 199, 231));
          view.setForeground(Color.white);
          view.setFont(new Font(&quot;Verdana&quot;, Font.BOLD, 15));
          view.setBounds(270, 125, 150, 50);
          
          startPanel.add(view);
          startPanel.add(add);
          startPanel.add(header);
  
          startPanel.setVisible(false);
          
          // Create second screen
          JPanel addPanel = new JPanel();
          addPanel.setBounds(230, 220, 500, 300);
          addPanel.setLayout(null);
          addPanel.setBackground(Color.black);
          
          JLabel header2 = new JLabel(&quot;INPUT DATA BELOW:&quot;);
          header2.setBounds(0, -25, 500, 150);
          header2.setFont(new Font(&quot;Verdana&quot;, Font.BOLD, 20));
          header2.setHorizontalAlignment(JLabel.CENTER);
          header2.setForeground(Color.white);
          
          JLabel costHeader = new JLabel(&quot;COST:&quot;);
          costHeader.setForeground(Color.white);
          costHeader.setFont(new Font(&quot;Verdana&quot;, Font.BOLD, 20));
          costHeader.setBounds(90, 75, 150, 50);
          
          JLabel typeHeader = new JLabel(&quot;TYPE:&quot;);
          typeHeader.setBounds(300, 75, 150, 50);
          typeHeader.setForeground(Color.WHITE);
          typeHeader.setFont(new Font(&quot;Verdana&quot;, Font.BOLD, 20));
          
          JTextField costInput = new JTextField(&quot;$0&quot;, 10);
          costInput.setFont(new Font(&quot;Verdana&quot;, Font.PLAIN, 20));
          costInput.setBounds(90, 150, 150, 50);
          costInput.setForeground(Color.white);
          
          JComboBox&lt;String&gt; jComboBox = new JComboBox&lt;&gt;(optionsToChoose);
          jComboBox.setFont(new Font(&quot;Verdana&quot;, Font.PLAIN, 20));
          jComboBox.setBounds(0, 0, 150, 50); 
          
          addPanel.add(jComboBox);
          addPanel.add(costInput);
          addPanel.add(typeHeader);
          addPanel.add(header2);
          addPanel.add(costHeader);
          
          addPanel.setVisible(true);
          
          // Add components
          window.add(startPanel);
          window.add(addPanel);
      }
  }
  </code></pre>
  <p>Here's the Window class as well:</p>
  <pre><code>import java.awt.Color;
  
  import javax.swing.JFrame;
  
  public class Window extends JFrame {
  
      public Window() {
          this.setTitle(&quot;Finance Tracker&quot;);
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          this.setResizable(false);
          this.setLayout(null);
          //this.setLocationRelativeTo(null);
          this.setSize(1000, 800);
          this.setVisible(true);
          
          this.getContentPane().setBackground(new Color(177, 177, 177));
      }
  }
  </code></pre>
  <p>If anyone has any idea as to why this could be happening, any help is appreciated. Thanks!</p>