title: Image on JPanel only flickers when moved
body: <p>I have a <code>BufferedImage</code> that I draw that doesn't show up unless I resize the window, and even then it only flickers:</p>
  
  <pre><code>// Remember, this is a JFrame class
  @Override
  public void paintComponents(Graphics g) {
      Graphics2D g2d = (Graphics2D) g;
      super.paint(g2d);
      Graphics p = drawPanel.getGraphics();
      for (int i = 0; i &lt; images.length; i++) {
          BufferedImage im = images[i];
          int ciw = getWidth() / 3;
          int cih = getHeight() / 2;
          int xpos = i % 3;
          int ypos = i / 3;
          int ix = i * ciw * xpos;
          int iy = i * cih * ypos;
          int iw = ciw;
          int ih = cih;
          p.drawImage(im, ix, iy, iw, ih, null);
      }
  //  drawPanel.paintComponents(p);
  //  drawPanel.repaint();
  }
  </code></pre>
  
  <p>I have done <code>drawPanel.setDoubleBuffered(true)</code>.</p>
  
  <p>If you want to see the whole code: <a href="https://github.com/firestar115/BCMaker" rel="nofollow"><code>https://github.com/firestar115/BCMaker</code></a></p>