Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Thread Error Message

Posted on 2004-09-01
7
Medium Priority
?
207 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
  • 4
  • 2
7 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

971 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