1. Nama: Kiuntoro
NPM: 201243501128
Kelas: R7H
Mata kuliah: Komputer Grafik
Dosen: Nahot Frastian, M.kom
Program Studi: Teknik Informatika
Universitas: Universitas Indraprasta PGRI
Program Komputer Grafik
Input:
import java.awt.Graphics;
public class grafikbatang1 extends java.applet.Applet{
public void paint(Graphics g){
int baris[]={50,50,450};
int kolom[]={50,450,450};
g.drawString("Grafik Batang", 125,475);
g.fillRect(75,250,50,200);
g.fillRect(150,100,50,350);
2. g.fillRect(225,300,50,150);
g.fillRect(300,250,50,200);
g.fillRect(375,150,50,300);
}
}
Proses :
drawstring dengan kalimat “Grafik Batang”, 125,475
fillRect dengan x = 75, y = 250, width = 50, height = 200
fillRect dengan x = 150, y = 100, width = 50, height = 350
fillRect dengan x = 225, y = 300,width = 50, height = 150
fillRect dengan x = 300, y = 250,width = 50, height = 200
fillRect dengan x = 375, y = 150, width = 50, height = 300