Tuesday, February 17, 2015

Java Applet Program to Draw Olympic Ring

import java.awt.*;
import javax.swing.*;

public class Olympic extends JApplet{

    public void paint(Graphics g){
   
        g.setColor(Color.blue);
        g.drawOval(10,10,100,100);
  

        g.setColor(Color.yellow);
        g.drawOval(60,60,100,100);
   
        g.setColor(Color.black);
        g.drawOval(120,10,100,100);
   
        g.setColor(Color.green);
        g.drawOval(180,60,100,100);
   
        g.setColor(Color.red);
        g.drawOval(230,10,100,100);
   
    }

}


Output will be like:

1 comment:

  1. Very informative article.Thank you author for posting this kind of article .

    http://www.wikitechy.com/view-article/applet-program-in-java-with-example



    Both are really good,.
    Cheers,
    Venkat

    ReplyDelete