Question: I'm having trouble drawing this pattern out, in my code. Bullseye Patch This patch is made up of a series of concentric circles centered on

I'm having trouble drawing this pattern out, in my code.

Bullseye Patch

This patch is made up of a series of concentric circles centered on the block. You should use a loop to draw multiple circles.

Note that since the Graphics method for drawing circles (drawOval()) measures an x and y position not from the center of the circle where you would expect, but from the upper left corner of the enclosing rectangle. So drawing an oval involves specifying a rectangle in which the circle will appear.

You can make a circle "filled in" by using the fillOval() command. If you want to put an outline on it, try using fillOval(), then changing the color, then using drawOval() with the same parameters. (Can you see why this works?)

Your circles should be at least two different colors.

Using this method here:

drawBullseyePattern

public void drawBullseyePattern(java.awt.Graphics g, int rx, int ry) 

Draws a bullseye pattern at the given coordinates

Parameters:

g - The graphics object to draw on

rx - the relative x-origin

ry - the relative y-origin

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!