title: How to add multiple components to a JFrame?
body: <p>I have a <strong>JFrame</strong>.</p>
  
  <p>I also have a <strong>Box</strong> class which extends <strong>Component</strong>.
  This box class has a <em>paint</em> method which makes a filled rectangle.</p>
  
  <p>When I add multiple of these Box components to my JFrame, only the most recently added one is displayed when I call <em>repaint</em> on the JFrame.</p>
  
  <p>I took a look at the layout managers, but I am not sure that's what I want. All I want is to be able to make an animation of whole bunch of rectangles wherever I want on the screen.</p>
  
  <p>(I also tried creating a panel, adding the panel to the JFrame, and then adding all the Box components to the panel. This did not work either).</p>
  
  <p>Thanks in advance!</p>