title: JPanel is just white/grey
body: <p>EDIT2: I also get a white/grey area, if I try to add a JLabel to the area, where the checkboxes are, that you see in the second image.</p>
  
  <p>EDIT: <strong>Also note this:</strong> When I just create a JLabel and add it before totalResultArea is added to panelResults, it also only shows a white/grey area.</p>
  
  <p>I created two JPanels <code>panelResults</code> and <code>totalResultArea</code>, <strong>but only see a white/grey area for the second panel (<code>totalResultArea</code>).</strong></p>
  
  <p>At first I set the layout of <code>panelResults</code> to <code>GridBagLayout</code></p>
  
  <pre><code>JPanel panelResults = new JPanel();
  JPanel totalResultArea = new JPanel();
  panelResults.setLayout(new GridBagLayout());
  </code></pre>
  
  <p>Then I add the <code>totalResultArea</code> to <code>panelResults</code>:</p>
  
  <pre><code>GridBagContraints  c = new GridBagConstraints();
  totalResultArea.setLayout(new BoxLayout(totalResultArea, BoxLayout.Y_AXIS));
  c.gridx = 0;
  c.gridy = 0;
  c.gridwidth = 2;
  c.weightx = 2;
  panelResults.add(totalResultArea, c);
  </code></pre>
  
  <p>In a click-event-listener of a button I add a <code>JLabel</code> to the <code>totalResultArea</code> and set the <code>JFrame</code> visible:</p>
  
  <pre><code>JLabel totalResultsText = new JLabel("&lt;html&gt;&lt;body&gt;...&lt;/body&gt;&lt;/html&gt;");
  totalResultArea.add(totalResultsText);
  
  // revalidate and repaint totalResultArea and panelResults
  totalResultArea.revalidate();
  totalResultArea.repaint();
  panelResults.revalidate();
  panelResults.repaint();
  
  // add panelResults to frame
  frame.getContentPane().add(panelResults, BorderLayout.NORTH);
  
  // invalidate, repaint the frame and make it visible 
  frame.invalidate();
  frame.repaint();
  frame.setVisible(true);
  </code></pre>
  
  <p>This all looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/z4NAc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z4NAc.png" alt="white/grey JPanel"></a></p>
  
  <p><a href="https://i.stack.imgur.com/KWM8f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KWM8f.png" alt="enter image description here"></a></p>
  
  <p>I hope you can reproduce this. If not see the picture.</p>
  
  <p><strong>What could be the reson, that I don't see the text from the JLabel, but an only white/grey area?</strong></p>