title: Set background color in java Graphics object
body: <p>Good day,</p>
  
  <p>Know that in Java Graphics object, we can user the <code>setColor()</code> method to set the object color. But this is only apply to the object border. Is it anyway to set color for the whole object? I means the background of the Graphics object.</p>
  
  <pre><code>void draw(Graphics g)
      {
          g.setColor(color);
          g.drawRect(left, right, width, height);
  
      }
  </code></pre>
  
  <p>Kindly advise.</p>