title: Draw a battery like bullet counter with java fillRect
body: <p>I'm working in a game and now i'm stuck in a dumb part of the gui i can't realize the right way to do it</p>
  <p>here is my logic of the bullet counter:</p>
  <pre><code>        g.setColor(Color.black);
          g.fillRect(600,20,120,40);
          g.setColor(Color.white);
          g.fillRect(605,25,110,30);
  
  
          for(int i=0;i &lt; player.ammo;i++){
              g.setColor(Color.black);
              g.fillRect(610+(i*5),30,20,20);
  
          }
          bs.show();
  </code></pre>
  <p>This is actually working fine, the problem is that the bullet counter grow as a single bar, and i want it to grow in individual rectangles like this: ▐▐▐▐▐▐▐▐ just like a camera battery level indicator, i've tried everything i could possibly think.</p>
  <p>Obs.: If possible i would like to do it only using the methods of image.getGraphics()(idk if that last sentence make sense)</p>
  <p>Thanks in advance</p>