title: Java - Color Rectangle
body: <pre><code>import java.awt.Graphics;
  import javax.swing.JPanel;
  import java.awt.Color;
  public class DrawPanel extends JPanel {
      public void paintComponent(Graphics g) {
          int height = getHeight();
          int width = getWidth();
          g.drawRect(350, 510, 110, 170);
          g.drawRect(470, 510, 110, 170);
          g.drawRect(590, 510, 110, 170);
          g.drawRect(710, 510, 110, 170);
          g.drawRect(830, 510, 110, 170);
          g.drawRect(350, 30, 110, 170);
          g.drawRect(470, 30, 110, 170);
          g.drawRect(590, 30, 110, 170);
          g.drawRect(710, 30, 110, 170);
          g.drawRect(830, 30, 110, 170);
          g.setColor(Color.RED);
          g.drawRect(110, 450, 110, 170);
          g.drawRect(110, 60, 110, 170);
      }
  }
  </code></pre>
  
  <p>I need to color red every Rectangle ( i mean inside the Rectangle ), but with this g.setColor ( Color.RED ) ; i can only color the exterior part of Rectanlge</p>