Sunday, 24 June 2012

java program to draw a swastik in applet

import java.applet.*;
import java.awt.*;
 /* <applet code ="Swastik" width=600 height=600>
    </applet>  */

  public class Swastik extends Applet
    {
     public void paint(Graphics g)
       {
        g.setColor(Color.yellow);
        g.drawOval(40,40,120,150);
        g.setColor(Color.cyan);
        g.drawArc(92,40,13,40,180,180);
        g.fillOval(68,81,10,10);
      



        g.fillOval(121,81,10,10);
        g.drawOval(57,75,30,20);
        g.drawOval(110,75,30,20);

        g.fillOval(68,81,10,10);
        g.fillOval(121,81,10,10);

        g.setColor(Color.black);
       // g.fillOval(85,100,30,30);
        g.setColor(Color.red);
        g.fillArc(60,125,80,40,180,180);

        g.fillOval(27,92,15,30);
        g.fillOval(158,92,15,30);
        g.setColor(Color.blue);
        g.drawOval(27,110,15,30);
        g.drawOval(157,110,15,30);
       }
    }

No comments:

Post a Comment