Ask Question
11 August, 08:57

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

}

+4
Answers (1)
  1. 11 August, 11:35
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers