title: Why shouldn't I call setVisible(true) before adding components?
body: <p>I've seen it written on this site a number of times (such as <a href="https://stackoverflow.com/a/5444335/626796">here</a>, and <a href="https://stackoverflow.com/a/10790307/626796">here</a>) that you mustn't call <code>setVisible(true)</code> before adding components to a <code>JComponent</code>, but I haven't seen an explanation, and information on the internet seems scarce.</p>
  
  <p>Why is this the case, and what happens if you break the rule?</p>