metamorphy
Programmer
Im very new to java trying to compile and run a very basic threaded applet. No matter what I do, I keep getting the "class cannot be instantiated" error on Internet explorer. Can someone please show me the error of my ways.
Here's the code I am using which compiles just fine on Windows:
import java.applet.*;
import java.awt.*;
public class test extends Applet implements Runnable {
Thread t = null;
public void init() {
System.out.println("init"
}
public void destroy() {
System.out.println("destroy"
}
public void start() {
System.out.println("start(): begin"
if ( t == null ) {
System.out.println("start: creating thread"
t = new Thread( this );
t.start();
}
}
public void stop() {
System.out.println("stop"
}
public void run() {
System.out.println("run..."
/* loop to do something meaningful here... */
}
public void paint( Graphics g ) {
System.out.println("paint..."
}
}
Thanks for the help....
Here's the code I am using which compiles just fine on Windows:
import java.applet.*;
import java.awt.*;
public class test extends Applet implements Runnable {
Thread t = null;
public void init() {
System.out.println("init"
}
public void destroy() {
System.out.println("destroy"
}
public void start() {
System.out.println("start(): begin"
if ( t == null ) {
System.out.println("start: creating thread"
t = new Thread( this );
t.start();
}
}
public void stop() {
System.out.println("stop"
}
public void run() {
System.out.println("run..."
/* loop to do something meaningful here... */
}
public void paint( Graphics g ) {
System.out.println("paint..."
}
}
Thanks for the help....