Drawing National flag using Java Applet

 Drawing National flag using Java Applet

 import java.io.*;
import java.applet.*;
import java.awt.*;
public class flag extends Applet
{
    public void paint(Graphics g)
    {
        g.fillOval(60,450,120,50);
        g.fillRect(110,60,10,400);
        g.setColor(Color.red);
        g.fillRect(120,80,150,30);
        g.setColor(Color.white);
        g.fillRect(120,110,150,30);
        g.setColor(Color.green);
        g.fillRect(120,140,150,30);
        g.setColor(Color.black);
        g.drawRect(120,80,150,90);
        g.setColor(Color.blue);

        g.drawOval(180,110,30,30);
        int t=0;
        int x=195,y=125;
        double x1,y1;
        double r=15;
        double d;
        for(int i=1;i<=24;i++)
        {
            d=(double)t*3.14/180.0;
            x1=x+(double)r*Math.cos(d);
            y1=y+(double)r*Math.sin(d);
            g.drawLine(x,y,(int)x1,(int)y1);
            t+=360/24;
        }
    }
}

Comments

  1. Thanks for your comment. Comment like this encourages to post more. Surely will do post more things.

    ReplyDelete
  2. Post is very useful. Thank you, this useful information.

    Upgrade your career Learn SAP ABAP Training from industry experts get Complete hands-on Training, Interview preparation, and Job Assistance at Softgen Infotech Located in BTM Layout.

    ReplyDelete
  3. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    angular js training in chennai

    angular js training in tambaram

    full stack training in chennai

    full stack training in tambaram

    php training in chennai

    php training in tambaram

    photoshop training in chennai

    photoshop training in tambaram

    ReplyDelete
  4. All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts



    oracle training in chennai

    oracle training in annanagar

    oracle dba training in chennai

    oracle dba training in annanagar

    ccna training in chennai

    ccna training in annanagar

    seo training in chennai

    seo training in annanagar

    ReplyDelete
  5. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    hadoop training in chennai

    hadoop training in omr

    salesforce training in chennai

    salesforce training in omr

    c and c plus plus course in chennai

    c and c plus plus course in omr

    machine learning training in chennai

    machine learning training in omr

    ReplyDelete
  6. href="https://istanbulolala.biz/">https://istanbulolala.biz/
    5İAWE

    ReplyDelete

Post a Comment

Popular posts from this blog

CELog and Kernel Tracker

WinCE Essentials Volume and File Control