Java Drawline, Drawrect, Fillrect, Clearrect Ve Drawrect3d Uygulaması

advertisement
Java Drawline, Drawrect, Fillrect, Clearrect Ve Drawrect3d Uygulaması
Java Drawline, Drawrect, Fillrect, Clearrect Ve Drawrect3d
Uygulaması
Drawline drawrect ile hazırlarmış bir karenin taralanmış alanı gösteren şekil ;
import java.awt.Graphics;
import javax.swing.JApplet;
public class offf extends JApplet {
public void init() {
}
public void paint(Graphics Ekran) {
for (int y = 10; y < 125; y += 25) {
Ekran.fillRect(y + 55, 125 - y, 145 - y, 30); // Yapışkan 1.
merdiven
Ekran.fillRect(200, 125 - y, 145 - y, 30); // Yapışkan 2.
merdiven
Ekran.fillRect(50, 250 + y, 145 + y, +30); // // Ayrı 3.
merdiven
}
}
}
Ekran Çıktısı;
dersmax.net
Java Drawline, Drawrect, Fillrect,
Clearrect Ve Drawrect3d Uygulaması
1
Java Drawline, Drawrect, Fillrect, Clearrect Ve Drawrect3d Uygulaması
ClearRect kullanarak yapılmış basit bir örnek;
import
import
import
import
java.awt.Color;
java.awt.Font;
java.awt.Graphics;
javax.swing.JApplet;
public class deneme extends JApplet {
public void init() {
setBackground(Color.BLACK);
}
public void paint(Graphics Ekran) {
Ekran.setColor(Color.red);
for (int x = 10; x < 125; x += 25) {
Ekran.fill3DRect(10, x, 20, 20, true);
Ekran.fill3DRect(150, x, 20, 20, true);
Ekran.fill3DRect(250, x, 20, 20, true);
}
Ekran.fill3DRect(33, 10, 20, 20, true);
Ekran.fill3DRect(60, 10, 20, 20, true);
Ekran.fill3DRect(83, 10, 20, 20, true);
Ekran.fill3DRect(95, 35, 20, 20, true);
Ekran.fill3DRect(95, 60, 20, 20, true);
Ekran.fill3DRect(63, 60, 20, 20, true);
Ekran.fill3DRect(33, 60, 20, 20, true);
Ekran.setFont(new Font("Jokerman", Font.ITALIC, 50));
Ekran.drawString("OZEKEN", 20, 180);
for (int x = ; x < 120; x += 25) {
Ekran.fill3DRect(125 + x, x - 25, 22, 22, true);
}
}
dersmax.net
Java Drawline, Drawrect, Fillrect,
Clearrect Ve Drawrect3d Uygulaması
2
Java Drawline, Drawrect, Fillrect, Clearrect Ve Drawrect3d Uygulaması
}
Ekran Çıktısı;
Polat Niyazi ÖZEKEN
dersmax.net
Java Drawline, Drawrect, Fillrect,
Clearrect Ve Drawrect3d Uygulaması
3
Download