Java Drawrect, Fillrect , Clearrect , Draw3drect Ve Fill3drect
Java drawrect, fillrect , clearrect , draw3drect ve fill3drect kullanımı
import java.awt.Font;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class NewJApplet extends JApplet {
public void init() {
}
public void paint(Graphics e){
Font d=new Font("Doruk",Font.ITALIC,18);
e.setColor(Color.BLUE);
e.fillRect(10,10,200,100);
e.setColor(Color.CYAN);
e.fillRect(15,15,190,90);
e.setColor(Color.DARK_GRAY);
e.fillRect(20,20,180,80);
e.setColor(Color.GRAY);
e.fillRect(25,25,170,70);
e.setColor(Color.GREEN);
e.fillRect(30,30,160,60);
e.setColor(Color.ORANGE);
e.fillRect(35,35,150,50);
e.setColor(Color.MAGENTA);
e.fillRect(40,40,140,40);
e.setColor(Color.RED);
e.fillRect(45,45,130,30);
e.setColor(Color.YELLOW);
e.fillRect(50,50,120,20);
e.setColor(Color.BLACK);
e.setFont(d);
e.drawString("Doruk",88,66);
}
}
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class NewJApplet extends JApplet {
public void init() {
}
public void paint(Graphics e){
Font d=new Font("Doruk",Font.ITALIC,18);
e.setColor(Color.BLUE);
e.fillRect(10,10,200,100);
e.setColor(Color.CYAN);
e.fillRect(15,15,190,90);
e.setColor(Color.DARK_GRAY);
e.fillRect(20,20,180,80);
e.setColor(Color.GRAY);
e.fillRect(25,25,170,70);
e.setColor(Color.GREEN);
e.fillRect(30,30,160,60);
e.setColor(Color.ORANGE);
e.fillRect(35,35,150,50);
e.setColor(Color.MAGENTA);
e.fillRect(40,40,140,40);
e.setColor(Color.RED);
e.fillRect(45,45,130,30);
e.setColor(Color.YELLOW);
e.fillRect(50,50,120,20);
e.setColor(Color.BLACK);
e.setFont(d);
e.drawString("Doruk",88,66);
}
}
import java.awt.Font;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class NewJApplet1 extends JApplet {
public void init() {
}
public void paint (Graphics e ){
e.fillRect(10,10,200,100);
e.clearRect(25,25,170,70);
//clearRect' te cizdiğimiz karenin rengi tabanla aynı olur
}
}
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class NewJApplet1 extends JApplet {
public void init() {
}
public void paint (Graphics e ){
e.fillRect(10,10,200,100);
e.clearRect(25,25,170,70);
//clearRect' te cizdiğimiz karenin rengi tabanla aynı olur
}
}
import java.awt.Image;
import java.awt.Font;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.CropImageFilter;
import java.awt.image.FilteredImageSource;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class NewJApplet2 extends JApplet {
Image Resim,KesilmisResim;
public void init() {
}
public void paint (Graphics g ){
g.setColor(Color.green);
g.setFont(new Font("doruk",Font.PLAIN,18));
g.draw3DRect(10,10,100,100,true);
g.fill3DRect(120,10,100,100,true);
g.draw3DRect(10,120,100,100,false);
g.fill3DRect(120,120,100,100,false);
}
}
import java.awt.Font;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.CropImageFilter;
import java.awt.image.FilteredImageSource;
import javax.swing.JApplet;
import javax.swing.JOptionPane;
public class NewJApplet2 extends JApplet {
Image Resim,KesilmisResim;
public void init() {
}
public void paint (Graphics g ){
g.setColor(Color.green);
g.setFont(new Font("doruk",Font.PLAIN,18));
g.draw3DRect(10,10,100,100,true);
g.fill3DRect(120,10,100,100,true);
g.draw3DRect(10,120,100,100,false);
g.fill3DRect(120,120,100,100,false);
}
}
Dorukhan Anur
Yorumunuzu Ekleyin