I have this class for creating a thread in Java
package org.vdzundza.forms;
import java.awt.Graphics;
import java.awt.Graphics2D;
public class DrawThread exten
You are passing an instance of your DrawThread
to a Thread(Runnable)
constructor. It doesn't care that your class extends Thread
; it only cares that it implements Runnable
.
The thread that gets started is the one created by new Thread(...)
—and you didn't set the name on that one.
In general, extending Thread
is bad practice and should always be avoided. You are already almost there because you don't start
the instance of your class, but pass it to a separate Thread
instance.