Ask 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 center are (250, 150)

public void paint (Graphics g)

{

/ / your code goes here

}

+3
Answers (1)
  1. 2 May, 14:42
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers