Don't Wait,Do it yourself.

Latest courses

sine wave in java programming using graphics

PROGRAM


import javax.swing.JFrame;
import java.awt.*;
class Test extends JFrame{
    Test()   //constructor for Test class
    {    setTitle("DDR");    // jframe title
        setSize(1000,1000);                  // jframe size
        setVisible(true);                       //set visibility
        setDefaultCloseOperation(EXIT_ON_CLOSE);
}

    public void paint(Graphics g)
    {
          g.setColor(Color.BLACK);
          g.drawLine(350,500,1000,500);
          g.drawLine(350,600,350,200);
          g.drawArc(350, 450, 100, 100, 0, 180);
          g.drawArc(450, 450, 100, 100, 0, -180);
          g.drawArc(550, 450, 100, 100, 0, 180);
          g.drawArc(650, 450, 100, 100, 0, -180);
          g.drawArc(750, 450, 100, 100, 0, 180);
          g.drawArc(850, 450, 100, 100, 0, -180);
    }

    public static void main(String [] args)
    {
        Test t=new Test();
       
    }
}



OPUTPUT :-

1 comment:

  1. very simple without any mimf blogging only required simple graphics and core java knowledge.

    ReplyDelete

Please do not enter any spam link in the comment Box