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
Get step-by-step solutions from verified subject matter experts
