| | |
thread question
Thread Solved |
You can have the class extend the Thread class.
If you don't want to change the code of the old class though you can try to create a new one that extends the old and implements the Runnable interface:
Runnbale
If you don't want to change the code of the old class though you can try to create a new one that extends the old and implements the Runnable interface:
Runnbale
Java Syntax (Toggle Plain Text)
public NewClass extends OldClass implements Runnable { public void run() { ...... } }
Check out my New Bike at my Public Profile at the "About Me" tab
•
•
Join Date: Apr 2008
Posts: 972
Reputation:
Solved Threads: 145
You can use an anonymous inner class. Something like:
Java Syntax (Toggle Plain Text)
new Thread(){ public void run() { // some lines of code } }.start();
![]() |
Similar Threads
- Windows question (Python)
- Best practices question (C++)
- why is a thread "closed"? (DaniWeb Community Feedback)
- simple thread question (C++)
- simple question regarding array (C++)
- thread question (Java)
- quick question (C)
- One more question about Remote desktop (Networking Hardware Configuration)
- qbasic program under Windows XP (Legacy and Other Languages)
Other Threads in the Java Forum
- Previous Thread: Database
- Next Thread: File reading problem
| Thread Tools | Search this Thread |
3d 6 @param affinetransform android api applet application arc array arrays automation binary bluetooth bold byte c++ chat class client code color compare component coordinates database detection doctype eclipse educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework html ide ideas image ingres input integer internet intersect j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list loop map method methods mobile netbeans newbie nextline object pong print problem producer program programming project projectideas read recursion recursive replaysolutions rim scanner sell server set size sms sort sql string swing terminal threads tree web websites windows






