At 05:48 PM +1100 06/29/98, Markian Jaworsky wrote:
>(Not sure if this got through - reposting)
>
>Specifically, when compiling a program which uses threads comes with:
>robot.java -
>"Could not instantiate /java/lang/Thread"
>
>//robot.java, an intended java 1.1 program
>import java.awt.*;
>import java.awt.applet.*;
>
>// The Thread class hasn't changed from 1.0 to 1.1 has it? ;)
>public class robot extends Applet implements Runnable {
>   Thread animator;
>   public void start() { (if animator == null) animator.start(); }

// try this:
public void start() {
   if (animator == null) {
      animator = new Thread(this);
      animator.start();
   }
}


>   public void stop() { if animaotr != null) animator.stop(); }
>   public void run() { //some code }
>}
>


Reply via email to