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

public class generalPathSWF_2000 extends JFrame {

    final static Color kirmizi=Color.red;
    final static Color beyaz=Color.white;
    final static Color siyah=Color.black;

    public generalPathSWF_2000()
    {
        super("ikinci ve üçüncü dereceden genel eğri çizimi");
    }

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
        RenderingHints.VALUE_ANTIALIAS_ON);
        setBackground(Color.lightGray);
        setForeground(siyah);
        Dimension boyut=getSize();
        int dx=boyut.width;
        int dy=boyut.height;
        g2.setPaint(siyah);
        g2.setStroke(new BasicStroke(3));
        g2.draw3DRect(0,0,dx-3,dy-3,true);
        g2.draw3DRect(3,3,dx-7,dy-7,false);
        GeneralPath sekil=new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        sekil.moveTo(20,20);
        //quadratik ekleme
        sekil.quadTo(160,120,245,45);
        //kübik ekleme
        sekil.curveTo(195,95,295,145,245,195);
        sekil.curveTo(-80,110,345,110,20,195);
        sekil.curveTo(400,250,200,250,20,20);
        g2.draw(sekil);
    }

    //=====================================================
      public static void main(String[] args)
      {
      generalPathSWF_2000 pencere= new generalPathSWF_2000();
      pencere.addWindowListener(new BasicWindowMonitor());
      pencere.setSize(400,300);
      pencere.setVisible(true);
      }
}
