Solved

Thread Error Message

Posted on 2004-09-01
7
203 Views
Last Modified: 2010-03-31
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?
0
Comment
Question by:iismatt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 11959988
Thread ctor expects an instance of Runnabel.
so your class needs to implement Runnable
0
 
LVL 92

Expert Comment

by:objects
ID: 11959995
and thus will also need a run() method

public void run()
{
   // code to run in thread goes here
}
0
 
LVL 18

Expert Comment

by:armoghan
ID: 11959997
have you implemented the run method ?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Author Comment

by:iismatt
ID: 11960002
Yes...

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

      void runProg() {
            if (t_movement==null); {
                  Thread t_movement = new Thread(this);
                  t_movement.start();
            }
      }
0
 
LVL 92

Expert Comment

by:objects
ID: 11960030
then you just need to define that your class implements Runnable

public class myclass implements Runnable
{
...
0
 
LVL 1

Author Comment

by:iismatt
ID: 11960069
Yup, objects, you're right.  I forgot to implement Runnable.  Thanks.
0
 
LVL 92

Expert Comment

by:objects
ID: 11960092
no worries :)
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question