If the height and width of the specified rectangle are both the same,
what type of figure does drawOval()
draw?
A circle.
drawOval()
![]() |
Look at:
drawOval( int X, int Y, int width, int height)
All the measurements are in terms of pixels.
The (X, Y) position is relative to the upper left hand corner of the applet's
drawing area.
It gives the location of the upper left corner of a rectangle.
The width
and height
arguments give the horizontal
and vertical size of the rectangle.
The drawOval()
method draws the oval that fits inside the rectangle
(it does not actually draw the rectangle.)
Notice that you do not give the method the center and radius of
the circle you want.
When used with other drawing tools, it is more convenient for drawOval()
to use rectangle-like arguments.