Kyfi's Blog

jawaban v-class

Posted on: April 4, 2012

jawaban no 1:

 *      Hello.java
 */
import java.applet.Applet;
import java.awt.Graphics;

public class Hello extends Applet{
    public void paint(Graphics g){
        g.drawString(“Hello world!”, 100, 100);
    }
}
jawaban no 2:

CircleLine2.java
 */
import java.applet2.*;
import java.hitungluas.*;
import java.awt.event.*;
import java.lang.Math;

public class  CircleLuas extends Applet{
    
    int lebar;
    int tinggi;
    
    public void init() {
    
        lebar = getSize().width;
        tinggi = getSize().height;
    }
    
    
    public void paint(Graphics g){
            
        for (int a = 0 ; a<lebar ; a = a + 5)
        {
            //g.drawLine(50,0,50,200);
            g.drawLine(a,0,a,tinggi);
        }    
                  
    }
}

 

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

%d blogger menyukai ini: