If you're just using the sleep method in Thread class, you don't have
to extend the Thread class especially you are already extending the
Applet class. Try this sample:
public class SampleSleep {
//Put the throws Exception class to the calling method
public static void main(String[] args) throws Exception {
System.out.println("Hello World will print after 5 seconds...");
//call the sleep method of the Thread class
Thread.sleep(5000);
System.out.println("Hello World");
}
}
Just don't forget to put the throws Exception to the calling method.