Drawing a Rectangle
by, 03-06-2012 at 08:51 PM (415 Views)
RectangularShape class implements the shape interface, in which few more methods are added of its own.
Such methods are used to find out certain information regarding the size and location of shape so that to find out the rectangle’s center point and to set the shape’s bounds.
Dimension w,x,h and location x,y defines a rectangle. These given methods specify rectangle in float or double precision.
Creation of a rectangle is explained by this given code.
Consider these parameters to specify rounded rectangles:Java Code:// draw Rectangle2D.Double g2.draw(new Rectangle2D.Double(x, y, rectwidth, rectheight));
- Height of the corner arc
- Width of the corner arc