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

public class qeneralcurveP extends JPanel
{
        public void paintComponent(Graphics g) {
        super.paintComponent(g);
	    Graphics2D g2 = (Graphics2D)g;
        setBackground(Color.lightGray);
        Dimension boyut=getSize();
        int dx=boyut.width;
        int dy=boyut.height;
        g2.setStroke(new BasicStroke(3));
        g2.draw3DRect(0,0,dx-3,dy-3,true);
        g2.draw3DRect(3,3,dx-7,dy-7,false);
        GeneralPath shape=new GeneralPath(GeneralPath.WIND_EVEN_ODD);
        shape.moveTo(20,20);
        //quadratik ekleme
        shape.quadTo(160,120,245,45);
        //kübik ekleme
        shape.curveTo(195,95,295,145,245,195);
        shape.curveTo(-80,110,345,110,20,195);
        shape.curveTo(400,250,200,250,20,20);
        g2.draw(shape);
    }


}

