title: JPanel not displaying in JFrame - Java
body: <p>Server is a class I made that extends JFrame.</p>
  
  <pre><code>    Server serverApp = new Server(TITLE, WIDTH, HEIGHT, true, false);
  </code></pre>
  
  <p>I've effectively removed almost all the other code but the problem still remains!</p>
  
  <pre><code>    c = getContentPane();
      c.setLayout(new BorderLayout());
  
      //Components  /***AHHHHH***/
      lblEnterMessage = new JLabel("Enter Message ");
      txtEnterMessage = new JTextField(50);
      txtEnterMessage.addActionListener(this);
      btnSend = new JButton("Send");
      btnSend.addActionListener(this);
      taDisplay = new JTextArea("Test, test test.", 10, 0);
      taDisplay.setEditable(false);
      JScrollPane jspDisplay = new JScrollPane(taDisplay);
  
      pnlChatTop = new JPanel(new FlowLayout());
      pnlChatTop.add(lblEnterMessage);
      pnlChatTop.add(txtEnterMessage);
      pnlChatTop.add(btnSend);
      pnlChat = new JPanel(new BorderLayout());
      pnlChat.add(pnlChatTop, BorderLayout.CENTER);
      pnlChat.add(jspDisplay, BorderLayout.SOUTH);
  
      c.add(pnlChat, BorderLayout.CENTER);
  </code></pre>
  
  <p>Oh dang, it just suddenly WORKED... And I was about to remove this question but I ran it again a few times it and just randomly WORKS and doesn't WORK at times.</p>
  
  <p>I've just remembered having this problem before with other 'projects' and my solution was to make the window resizable. Whenever I simply resized it, the components would display.</p>
  
  <p>This time, I'm making a game and I don't want it to be resizable... and I wanna know how to fix this problem for good and in the proper way anyway.</p>
  
  <p>Help! Does anyone know why this is happening?</p>
  
  <p>Thanks.</p>
  
  <p>Edit:</p>
  
  <pre><code>public Server(String title, int sizeW, int sizeH, boolean visibility, boolean resizability) {
  
      /* Initialization */
      //JFrame settings
      setTitle(title);
      setSize(sizeW, sizeH);
      setVisible(visibility);
      setResizable(resizability);
      setLocationRelativeTo(null);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      addKeyListener(this);
  </code></pre>
  
  <p>Will that help?</p>