Iqbal Koplak...!!!

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Rabu, 17 Oktober 2012

Membuat gambar rumah pada Java menggunakan AWT pada Netbeans

Kali ini saya akan membagikan program membuat gambar rumah pada Java Netbeans menggunakan AWT







Berikut codingnya:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gambarAWT;
import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Panel;
import java.awt.Toolkit;
/**
 *
 * @author asus
 */
public class tamanAWT extends Panel {
    tamanAWT(){
    setBackground(new Color(255,255,255));
    }
   
    int x[] = new int[]{70, 110, 150};
    int y[] = new int[]{360, 300, 360};
    int a[] = new int[]{625, 625, 150, 150};
    int b[] = new int[]{230, 330, 600, 500};
   
   
   
    public void paint(Graphics k){
       
       
        k.setColor(Color.gray);
        k.drawLine(625, 230, 150, 500);
        k.drawLine(625, 330, 150, 600);
        k.fillPolygon(a, b, 4);
       
       
       
        k.setColor(Color.orange);
        k.drawLine(520, 200, 320, 20);
        k.drawLine(520, 20, 320, 200);
        k.drawLine(520, 110, 320, 110);
        k.drawLine(420, 15, 420, 200);
       
        k.setColor(Color.red);
        k.fillRect(70, 360, 80, 150);
       
        k.setColor(Color.orange);
        k.fillOval(380, 70, 80, 80);
       
       
       
       
       
        k.setColor(Color.blue);
        k.fillRect(110, 440, 40, 70);
       
        k.setColor(Color.DARK_GRAY);
        k.fillOval(120, 470, 10, 10);
        k.fillPolygon(x, y, 3);
       
        k.setColor(Color.WHITE);
        k.drawLine(625, 230, 150, 500);
        k.drawLine(625, 330, 150, 600);
        k.drawLine(485, 358, 504, 348);//x1,y1,x2,y2
        k.drawLine(425, 392, 444, 382);//x1,y1,x2,y2
        k.drawLine(365, 425, 385, 415);//x1,y1,x2,y2
        k.drawLine(300, 462, 320, 452);//x1,y1,x2,y2
       
        k.setColor(Color.gray);
        k.fillOval(100, 60, 80, 80);
        k.fillOval(100, 80, 80, 80);
        k.fillOval(60, 70, 80, 80);
        k.fillOval(140, 70, 80, 80);
       
    }
   
   
    public static void main(String[] args) {
        Frame f1 = new Frame();
        tamanAWT H = new tamanAWT();
        f1.add(H);
        f1.setSize(600, 545);
        f1.setVisible(true);
    }
}


Dan Screenshot Coding pd netbeans dan hasil runningnya:










Bila berkenan download file nya bisa di unduh dibawah ini:
File java Klik Disini
File class Klik Disini
File jar Klik Disini

Membuat gambar Smiley menggunakan AWT pada java

Kali ini saya akan membagi program untuk membuat gambar smile menggunakan AWT pada Netbeans






Berikut codingnya:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gambarAWT;
import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Panel;
import java.awt.Toolkit;
/**
 *
 * @author asus
 */
public class mukaAWT extends Panel {
    mukaAWT(){
    setBackground(new Color(245,70,70));
    }
   
    public void paint(Graphics k){
        k.setColor(Color.black);

        k.setFont(new Font("Algerian", Font.BOLD,16));
        k.drawString("Abu Rizal Al Ghifary", 30, 300);
        k.drawString("XII-RPL 3", 550, 300);
       
        k.setColor(Color.white);
        k.fillOval(287, 60, 80, 80);
       
        k.setColor(Color.MAGENTA);
        k.fillOval(310, 70, 10, 20);
        k.fillOval(330, 70, 10, 20);

        k.setColor(Color.blue);
        k.fillOval(310, 80, 9, 9);
        k.fillOval(330, 80, 9, 9);
       
        k.setColor(Color.DARK_GRAY);

       
        k.drawArc(300, 80, 55, 55, 0, -180);
       
       

    }
   
   
    public static void main(String[] args) {
        Frame f1 = new Frame();
        mukaAWT H = new mukaAWT();
        f1.add(H);
        f1.setSize(670, 350);
        f1.setVisible(true);
    }
}



dan screenshot Netbeans dan Hasil Runningnya:









Berikut link Download file nya bisa di unduh:
File java Klik Disini
File class Klik Disini
File jar Klik Disini