Ask Question
20 October, 23:44

Complete the code, drawing a solid circle (with the current color, whatever it is) so that its diameter is 200, and the coordinates of its center are (250, 150)

public void paint (Graphics g)

{

/ / your code goes here

}

+1
Answers (1)
  1. 21 October, 00:44
    0
    public void paint (Graphics g)

    {

    g. drawOval (150, 50, 200, 200); / /Draw a circle

    }

    Explanation

    drawOval (int X, int Y, int width, int height) this instruction draws an oval in the specified 'x' and 'y' coordinates, been this coordinates the left upper corner of a rectangle who perfectly fits the oval. The last two numbers are the width and height.

    X coordinate from the upper left corner. From the center location, move half of the width of the circle. (minus 100)

    Y coordinate from the upper left corner. From the center location, move half of the height of the circle. (minus 100)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Complete the code, drawing a solid circle (with the current color, whatever it is) so that its diameter is 200, and the coordinates of its ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers