Trouble drawing a rectangle. Below is the code for drawing a rectangle
and a filled rectangle (same rectangle)
In this scenario the frame on the top and the left side of the rectangle
does not show up.
The fill operation 'over' draws the frame.  When I switch the draw and
fill sequence it's ok.

Any ideas ? I am going n……

Thanks

Chris Roffler
---------------------------------------------
import javax.swing.*;
import java.awt.geom.*;
import java.awt.*;


public class Chris  
  extends  
  JPanel
{
  Rectangle2D r;

  public Chris()
  {
    super();

    r = new Rectangle2D.Float(10,10, 100,3);
    setBackground(Color.white);
  }


  public void paint(Graphics g)
  {
    Graphics2D d2 =(Graphics2D)g;

    d2.setBackground(Color.white);
    super.paint(d2);

    d2.setColor(Color.black);
    d2.draw(r);

    d2.setColor(Color.white);
    d2.fill(r);

    System.out.println(r);


  }
}


Reply via email to