Need help overlapping circles - Olympic Logo -

I am asked to draw the Olympic logo, I 've drawn the the 5 circles, and cannot get the drawArc function to work- to interlock the 5 circles.

This is what I have gotten so far:

<code>

import java.applet.Applet;
import java.awt.*;

public class Hw5Pr1 extends Applet {
  public void paint(Graphics g) {
        // Blue Ring
    g.setColor(new Color(5, 120, 182));
    g.drawOval(0, 0, 100, 100);
    g.fillOval(0,0, 100, 100);
   
   // Rectangle rect = new Rectangle( 30, 30, 100, 100);
   // Color pn = new Color(5, 120, 182);
   // g.drawArc(pn, rect, 50, 100);
   
    g.setColor(new Color(255, 255, 255));
    g.drawOval(5, 5, 90, 90);
    g.fillOval(5, 5, 90, 90);
    // Black Ring
    g.setColor(new Color(0, 0, 0));
    g.drawOval(110, 0, 100, 100);
    g.fillOval(110, 0, 100, 100);
    g.setColor(new Color(255, 255, 255));
    g.drawOval(115, 5, 90, 90);
    g.fillOval(115, 5, 90, 90);    
    // Red Ring
    g.setColor(new Color(251, 24, 51));
    g.drawOval(220, 0, 100, 100);
    g.fillOval(220, 0, 100, 100);
    g.setColor(new Color(255, 255, 255));
    g.drawOval(225, 5, 90, 90);
    g.fillOval(225, 5, 90, 90);      
    // Yellow Ring
    g.setColor(new Color(255, 173, 26));
    g.drawOval(50, 50, 100, 100);
    g.fillOval(50, 50, 100, 100);
    g.setColor(new Color(255, 255, 255));
    g.drawOval(55, 55, 90, 90);
    g.fillOval(55, 55, 90, 90);      
    // Green Ring
    g.setColor(new Color(12, 137, 73));
    g.drawOval(160, 50, 100, 100);
    g.fillOval(160, 50, 100, 100);
    g.setColor(new Color(255, 255, 255));
    g.drawOval(165, 55, 90, 90);
    g.fillOval(165, 55, 90, 90);  
  }
}

</code>

Could someone please help me draw one arc and I 'll hopefully do the rest.

Thanks
Coconut77840Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Coconut77840Author Commented:
I've been able to figure out how to draw the arc

<code>
    g.setColor(new Color(0, 0, 0));
    g.drawArc(110, 5, 95, 95, 185, 70);
</code>

Now, I need to know how to increase the number of pixels of that Arc, It can be done by drawing 10 arcs, but I guess this is not efficient as it would me quite a while.

Please advice
0
objectsCommented:
You'll need to use Swing to achieve that (without drawing 5 arcs).

Graphics2D g2d = (Graphics2D) g;
g.setStroke(new BasicStroke(5.0));
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Coconut77840Author Commented:
It's outputting a white page.

g.setStroke(new BasicStroke(5.0))   <-- isn't supposed to be g2d.setStroke ?
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Coconut77840Author Commented:
Got it to work.

Thank you
0
objectsCommented:
> g.setStroke(new BasicStroke(5.0))   <-- isn't supposed to be g2d.setStroke ?

oops, yes :)
0
Coconut77840Author Commented:
It looks very odd.
I took a snapshop of my desktop so you can get the feeling.

http://lobnan.net/Olympic.gif

Any suggestions?
0
objectsCommented:
your filling the middle with white which is overwriting anything under the fill.
0
Coconut77840Author Commented:
That's how I am asked to do it.

<quote>
Each ring can be drawn by filling a circle in color and then drawing a smaller white circle over it.
</quote>

Thanks
0
objectsCommented:
hmm, can't think how you avoid that affect using that approach.
I would have thought you'd just use drawArc()

maybe ask your lecturer for a clarification.
0
Coconut77840Author Commented:
I am re-doing this problem using only drawArc function. Hopefully it will clean up the mess in that logo.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.