Rectangle2D.Double theRectangle = 
     new Rectangle2D.Double(
                               0.0,0.0,size*ds,size*ds);
g2dImage.setPaint(new Color(0,255,0));//green
g2dImage.fill(theRectangle);
g2dImage.draw(theRectangle);

Figure 4