title: How can I make my JFrame background change colors wildly?
body: <p>I'm making a "GUI from Hell", and I'm trying to make the JFrame flash colors (change background rapidly) for a time long enough to be annoying. This is what I've got:</p>
  
  <pre><code>int changes = gen.nextInt(2000) + 5000;
  int red;
  int green;
  int blue;
  Color color;
  
  for (int i = 0; i &lt; changes; i++)
  {   
      color = new Color(gen.nextInt(256), gen.nextInt(256),
      gen.nextInt(256));
      // I first tried this...
      frameMain.getContentPane().setBackground(color);
      // Then I tried this, which only
      // appeared to change the color once and then proclaim
      // that it was done:
      panel1.setBackground(color);
      panel2.setBackground(color);
      panel3.setBackground(color);
  }
  </code></pre>
  
  <p><strong>Note:</strong> If you know how to easily make the entire JFrame and all of its contents change color (not just the background), that would be crazy and awesome, so let us in on that.</p>
  
  <p>Any guidance is appreciated! Hopefully I haven't just missed something silly...</p>
  
  <p><em>...and if you have an idea or two for a ridiculous GUI effect, feel free to share! :)</em></p>