Link to home
Start Free TrialLog in
Avatar of iismatt
iismatt

asked on

Thread Error Message

I am getting the error message

symbol : constructor Thread(PaintWindow)
location: class java.lang.Thread
            Thread t_movement = new Thread(this);

however, I have java.util.* defined in my class.  What gives?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
and thus will also need a run() method

public void run()
{
   // code to run in thread goes here
}
have you implemented the run method ?
Avatar of iismatt
iismatt

ASKER

Yes...

      public void run() {
            movingRandRect mrr = new movingRandRect();
      }

      void runProg() {
            if (t_movement==null); {
                  Thread t_movement = new Thread(this);
                  t_movement.start();
            }
      }
then you just need to define that your class implements Runnable

public class myclass implements Runnable
{
...
Avatar of iismatt

ASKER

Yup, objects, you're right.  I forgot to implement Runnable.  Thanks.
no worries :)