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

public class yildizciz2D extends JApplet {
   
    final static Color bg=Color.white;
    final static Color fg=Color.black;
    final static Color kirmizi=Color.red;
    final static Color beyaz=Color.white; 

    public void init() 
    {
        setBackground(bg);
        setForeground(fg);
    }


    public void paint(Graphics g) 
    {
        Graphics2D g2 = (Graphics2D) g;       
        Dimension boyut=getSize();
        int dx=boyut.width/2;
        int dy=boyut.height;
        //çerceve ciz
        g2.setPaint(renk.siyah);
        g2.draw3DRect(0,0,boyut.width-1,boyut.height-1,true);
        g2.draw3DRect(3,3,boyut.width-7,boyut.height-7,false);
        //cizgiciz
        yildizSW.drawYildiz(g,50,50, 5,40,0 );
        g2.setPaint(renk.kirmizi);
        yildizSW.fillYildiz(g,50,50, 5,40,0 );
        g2.setPaint(renk.mavi);
        yildizSW.drawYildiz1(g,150,50, 5,40,0 );

        }

    public static void main(String s[]) {
        JFrame f = new JFrame("yildiz ciz 2D ");
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {System.exit(0);}
        });
        JApplet applet = new yildizciz2D();
        f.getContentPane().add("Center", applet);
        applet.init();
        f.pack();
        f.setSize(new Dimension(550,200));
        f.show();
    }

}
