Thread Applet
:: ǡѺǹʴŢͧ :: Java Applet
หน้า 1 จาก 1
Thread Applet
package thread;
import java.applet.Applet;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
public class Counter extends Applet implements Runnable {
int count=0;
public void init() {
setFont(new Font("Angsana NEW", Font.PLAIN,29));
setForeground(Color.red);
new Thread(this).start();
// ͧǹ new Thread().start(); Դâ
}
public void paint(Graphics g) {
g.drawString(String.valueOf(count), 20, 20);
}
public void run() {
for(;count <= 60 ;count++){
try{
Thread.sleep(1000);
}catch (Exception e) { }
repaint();
}
}
public void stop() {
count = 1000;
}
}
Similar topics
» ???ʹ ??ѡ?ͧ Applet
» ?????? Applet ??Ѻ
» ??ػ applet ?ա????
» ??? add ??? Applet ???? Frame
» ????ʴ??ٻ? Applet ???ҧ????
» ?????? Applet ??Ѻ
» ??ػ applet ?ա????
» ??? add ??? Applet ???? Frame
» ????ʴ??ٻ? Applet ???ҧ????
:: ǡѺǹʴŢͧ :: Java Applet
หน้า 1 จาก 1
Permissions in this forum:
คุณไม่สามารถพิมพ์ตอบ