RumahEsti.java


/// RumahEsti.java
// ditulis : Esti HPM
// Mahasiswi Politeknik Harapan Bersama Tegal
// Prodi Komputer
// Kelas B
// Semester 2.
// 29 April 2009
import java.awt.*;
import javax.swing.*;
public class RumahEsti extends JFrame {
public RumahEsti()
{
super(“Gambar RumahEsti “);
setSize( 600, 600 );
setVisible( true );
}
public void paint( Graphics g )
{
super.paint( g );
// membersihkan layar dengan mengisi semua layar dengan warna hitam
g.setColor( Color.BLACK);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor( Color.WHITE);
g.setFont( new Font(“Serif”, Font.BOLD + Font.ITALIC, 36));
g.drawString(“Esti’s Home ” , 250, 100);
g.setColor(Color.YELLOW);
g.drawLine(200,50,450,50);
g.drawLine(450,50,500,150);
g.drawLine(500,150,250,150);
g.drawLine(250,150,200,50);
g.drawLine(200,50,250,150);
g.drawLine(250,150,150,150);
g.drawLine(150,150,200,50);
g.setColor(Color.YELLOW);
g.drawRect(150,150,100,100);
g.drawRect(250,150,250,100);
g.setColor(Color.RED);
g.fillRect(150,251,15,125);
g.fillRect(200,251,15,75);
g.fillRect(250,251,15,125);
g.fillRect(300,251,15,75);
g.fillRect(435,251,15,75);
g.fillRect(485,251,15,125);
g.setColor(Color.BLUE);
g.fillRect(300,160,100,50);
g.fillRect(200,200,50,50);
g.setColor(Color.GREEN);
g.setFont( new Font(“Monospaced”, Font.BOLD, 36));
g.drawString(“Rumahku adalah Surgaku ” , 60, 500);
g.setColor(Color.BLUE);
g.drawRect(50,450,500,100);
//sudut ranting kanan atas
g.setColor( Color.GREEN );
g.drawArc(80, 280, 50, 200,0, 180);
//sudur ranting kanan bawah
g.setColor( Color.GREEN );
g.drawArc(80, 110, 50, 550,0, 180);
//sudut bunga kuncup
g.setColor( Color.GREEN );
g.fillArc(112, 130, 5, 23,0,360);
//sudut bunga kuncup //yellow
g.setColor( Color.YELLOW );
g.fillArc(112, 140, 5, 13,0,360);
//sudut ranting kiri atas
g.setColor( Color.GREEN );
g.drawArc(-30, 150, 110, 450,0, 90);
//sudut ranting kiri tengah
g.setColor( Color.GREEN );
g.drawArc(-50, 200, 130, 350,0, 90);
//sudut ranting kiri bawah
g.setColor( Color.GREEN );
g.drawArc(30, 300, 50, 150, 0, 90);
//sudut bulan
g.setColor( Color.WHITE );
g.fillArc(40,45 , 60, 60,0,360);
//sudut awan kecil
g.setColor( new Color(200, 200,200));
g.fillArc(75,80, 20, 20,0,180);
//sudut awan besar
g.setColor(new Color(100, 100,100));
g.fillArc(35,60, 50, 50,0,180);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(130,110,4, 4,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(120,115,4, 4,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(125,130,5, 5,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(75,115,5, 5,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(40,125,4, 4,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(35,135,4, 4,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(220,130,5, 5,0,350);
//sudut bintang
g.setColor( Color.WHITE );
g.fillArc(210,110,4, 4,0,350);
}
public static void main( String arg[] )
{
RumahEsti application = new RumahEsti ();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
}
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s