Geometrik Şekillerin Çizilmesi
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
public class Bes extends Applet {
public void init() {
// TODO start asynchronous download of heavy resources
}
public void paint(Graphics LCDEkrani) {
LCDEkrani.drawRect(10, 10, 70, 90); //İci bos diktorgen cizer
LCDEkrani.setColor(Color.yellow); //Boyama rengini secer
LCDEkrani.fillRect(100, 10, 70, 90); //Ici dolu diktorgen cizer
LCDEkrani.setColor(Color.BLACK); //Boyama rengi siyah yapildi
LCDEkrani.drawRoundRect(200, 10, 70, 90, 15, 15); //Kenarları yuvarlatılmıs kare
//Color Renk1=new Color(0, 0, 0); //Renk tanımlanıyor
LCDEkrani.setColor(new Color(150, 100, 100));
LCDEkrani.fillRoundRect(300, 10, 70, 90, 25, 25); //Icic dolu yuvarlatilmis kare
LCDEkrani.drawOval(10, 150, 100, 100); //Ici bos daire
LCDEkrani.setColor(new Color(142, 204, 9));
LCDEkrani.fillOval(150, 150, 150, 150);
LCDEkrani.setColor(new Color(240, 9, 95));
LCDEkrani.fillArc(250, 150, 250, 150, 0, 45);
int xkoordinatlari[] = {30, 200, 30, 200, 30};
int ykoordinatlari[] = {330, 330, 500, 500, 330};
LCDEkrani.drawPolygon(xkoordinatlari, ykoordinatlari, 5);
}
// TODO overwrite start(), stop() and destroy() methods
}
Yorumunuzu Ekleyin