Threads are an interesting concept. Each Thread represents a separate thread of control. A thread of control is just a single sequetial task. Counting from 1 to 100 is a thread of control. Counting from 1 to 100 and, at the same time, drawing a filled oval on the screen takes two separate threads of control. The computer has to be able to do two things at once. The way you do that in Java (and most operating systems) is with Threads.
There are two ways to write an application that runs as a Thread. You can inherit it from Thread, or you can have it implement Runnable. In this lesson we'll discuss these two methods and look at some examples of using Threads, including animation.
Return to the Main Menu.