Beginner Java graphics - filling concentric circles with color
I have to do an exercise in which I'm supposed to draw olympic circles and color them in olympic color.
I don't have a problem with drawing them (I drew them as concentric circles).
My problem is coloring them.
I have 3 classes:
1.OlympicRing - it draws the outer and the inner circle
2.OlympicComponent - extends JComponent, creates 5 OlympicRing objects with different positions and colors
3.OlympicRingViewer (main method that creates a frame and adds the olympic component to it)
Now, I tried filling the outer ring with olympic color and inner ring with frame background color (code is from OlympicRing class):
This works with one ring. But if there's more of them and they intersect, their intersection areas get covered with background color.
Is there a way to give boundaries to the fill method ? Am I making any sense?