Java ile şanlı bayrağımız, ölçüleri pek tutturamamış olabilirim, Grafikçi arkadaşlar kusura bakmasın
kodlar: -------------------------------------------------------------
import javax.swing.*;
import java.awt.*;
import java.awt.geom.GeneralPath;
/**
* Created by IntelliJ IDEA.
* User: Administrator
* Date: Jun 13, 2006
* Time: 8:40:58 PM
* To change this template use File | Settings | File Templates.
*/
public class TurkishFlag extends JPanel {
public void paintComponent(Graphics g){
Graphics2D g2d= (Graphics2D) g;
int[] xPoints={355,367,409,373,383,355,327,337,301,343};
int[] yPoints={-20,16,16,34,76,52,76,34,16,16};
GeneralPath star= new GeneralPath();
star.moveTo(xPoints[0],yPoints[0]);
for(int count=1;count<xPoints.length;count++){
star.lineTo(xPoints[count],yPoints[count]);
}
g2d.setColor(Color.WHITE);
g.fillOval(100,50,180,180);
g2d.setColor(Color.RED);
g.fillOval(160,80,130,120);
g2d.setColor(Color.WHITE);
g2d.rotate(Math.PI/10.0);
g2d.fill(star);
star.closePath();
}
public static void main(String args[]){
JFrame frame= new JFrame("TURKIYA");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
TurkishFlag flag = new TurkishFlag();
frame.add(flag);
frame.setBackground(Color.RED);
frame.setSize(570,350);
frame.setVisible(true);
}
}
----------------------------------------------------------
screenshot: