Yikes!
- Your init() method will never return; it will loop forever creating threads (at least until the VM runs out of memory.)
- init() runs on the Swing event
thread, so the screen will never be repainted (since you're blocking the painting thread.) This means that the counter will never be incremented, which means that none of these threads will ever terminate.
- Every thread creates its own Car object, none of which will actually be displayed on the screen (only the original one will be) so all those repaint() calls won't do anything anyway!
To get you on the right track: rename your "init()" method to "start()", and get rid of that "while" loop; then in "run", get rid of the variable "c" altogether. Don't create any Car object, and refer to the member variable "i" implicitly.
Note that since you haven't overridden stop() to do anything, calling it will have no effect. What you want to do is break out of that while loop, not call stop().