title: JPanel Animated Background
body: <p>This is a really general question, but how should I add an animated background for a JPanel. I want the background to be behind all the panel's components and graphics. Right now, I have two separate classes (one for the main panel and the other for the background). The background class uses repaint() to animate a grid moving across the screen. I've tried to make the main panel background transparent, but that hasn't gotten me anywhere. </p>
  
  <p>Even more info:
  My main panel is part of a CardLayout and it has many different classes in it. So when I'm adding my main panel to my main frame, I'm doing <code>frame.getContentPane().add(cards, BorderLayout.CENTER)</code></p>
  
  <p><code>cards</code> is a JPanel which acts as a container for the mainpanel and all the panels inside main panel.</p>
  
  <p>Can anybody help me out in getting a panel animated background?</p>