Java Membuat Thread Gui


hmmmm… teman, udah lama juga ya gag  R92M ngepost coding,, nah ini neh boleh di simak…. ini buat bikin tul

 

public class KelasI extends JFrame implements Runnable {

Thread tr = new Thread(this);
int angka = 0;
String teks = “”;

public KelasI(){
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(300, 300);
setVisible(true);
tr.start();
}

public void paint(Graphics g){
super.paint(g);
g.drawString(teks, 0+(angka*10), 150);

}

@Override
public void run() {
while(true){
try {
Thread.sleep(1000);
angka++;
teks = String.valueOf(angka);
} catch (Exception e) {
}
repaint();
}
}

public static void main(String[] args) {
new KelasI();
}
}

Beli T-Shirt, Raglan dan Kids T-Shirt Original Ocean Seven

  1. T-Shirt, Raglan dan Kids T-Shirt Anime, Manga, Gamers dan Cartoon World (OceanSeven)
  2. T-Shirt, Raglan dan Kids T-Shirt Footbal Series (OceanSeven)
  3. T-Shirt, Raglan dan Kids T-Shirt Music Series (OceanSeven)
  4. T-Shirt, Raglan dan Kids T-Shirt OceanSeven – Custom dan Basic Tees (OceanSeven)
  5. T-Shirt, Raglan dan Kids T-Shirt OceanSeven -Kids Collections (OceanSeven)
  6. T-Shirt, Raglan dan Kids T-Shirt OceanSeven -Signature Serues (OceanSeven)
  7. T-Shirt, Raglan dan Kids T-Shirt  Social Media dan Photography (OceanSeven)
  8. T-Shirt, Raglan dan Kids T-Shirt Sport, Automotive dan Adventure (OceanSeven)
  9. T-Shirt, Raglan dan Kids T-Shirt Superheroes dan Movies (OceanSeven)

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