Hello everyone.
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):
g2.draw(outerRing);
g2.setColor(ringColor);
g2.fill(outerRing);
g2.draw(innerRing);
g2.setColor(g2.getBackground());
g2.fill(innerRing);
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?
Any suggestions?