PDA

View Full Version : applets and threads


alvaro_escorpio
01-22-03, 21:25
how can I handle threads with applets of java

Pulse
02-13-03, 16:28
According to me you use it the same way as in an Application..

You can create a thread in on of two ways ...

* Extend java.lang.Thread
You can then use your class in the following wa :

MyThread mt = new MyThread();
mt.start();

* Declare a class that implements the Runnable interface :

Thread runner;
class MyThread implements Runnable {
public void run() {
if (runner == null) {
runner = new Thread(this);
runner.start();
}
}
}