go to previous page   go to home page   go to next page

Answer:

grph.drawLine(  0, 149, 199, 0 )

Since the height is 150, and the numbering of pixels starts at zero, the Y coordinate of the lower left corner is 149.


drawOval()

Picture of an Oval

The method drawOval() is one of the methods of a Graphics object.

drawOval( int X, int Y, int width, int height )

This draws a circle or an oval that fits within the rectangle specified by the X, Y, width and height arguments. The oval is drawn inside a rectangle whose upper left hand corner is at (X, Y), and whose width and height are as specified.

The measurements are in terms of pixels. The (X, Y) position is relative to the upper left hand corner of the 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.)

To draw an oval with the interior filled with the current color use

fillOval( int X, int Y, int width, int height )

QUESTION 14:

If the height and width of the rectangle are both the same, what type of figure does drawOval() draw?