1)drawRect() :
drawRect () method display an outlined rectangle.
Syntax: void drawRect(int top,int left, int width,int height)
The upper-left corner of the Rectangle is at top and left. The dimension of the Rectangle is specified by width and height.
Example: g.drawRect(10,10,60,50);
2) drawOval( ): Drawing Ellipses and circles: To draw an
Ellipses or circles used drawOval () method can be used.
Syntax: void drawOval(int top, int left, int width, int height)
The ellipse is drawn within a bounding rectangle whose upperleft corner is specified by top and left and whose width and height are specified by width and height to draw a circle or filled circle, specify the same width and height the following program draws several ellipses and circle.
Example: g.drawOval(10,10,50,50);