title: Moving bat. repaint
body: <p>Hi guys I am trying to make a Halloween applet. I'm I am trying to make a bat that will move across the screen, but it just makes a line of bats. That is why I tried using repaint(), but I dont think I am using it correctly. What do I have to do to make it paint one bat and when I paint another one delete the first one? </p>
  
  <pre><code>for(x = 1; x &lt; 1000; x+=x)
        {
            ramX = generator.nextInt(max - min + 1) + min;
            ramY = generator.nextInt(max - min + 1) + min;
  
            int paint = 0;
  
            for(ramX = ramX; ramX &lt; 1350; ramX+=1)
            {  
            page.drawImage(bat, ramX, ramY, 100, 50, this);   
  
            paint++; 
            if (paint &gt; 3)
                {
                    repaint(); 
                    paint = 0; 
                }
            }
  
        }
  </code></pre>