title: Problem in generating the border of a rectangle in Java?
body: <p>I am using <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/geom/Rectangle2D.Double.html" rel="noreferrer">java.awt.geom.Rectangle2D.Double</a> class to generate a rectangle. I want to generate a rectangle which is filled with a color (say green) and have a border (outline).</p>
  
  <p>Now the problem is if I call</p>
  
  <pre><code>g2.draw(new Rectangle2D.Double(....)); // g2 is an instance of Graphics2D
  </code></pre>
  
  <p>then it doesn't fill the rectangle and when I call</p>
  
  <pre><code>g2.fill(new Rectangle2D.Double(....)); // g2 is an instance of Graphics2D
  </code></pre>
  
  <p>then id doesn't generate border.</p>