This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Problems with Threads in an Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Problems with Threads in an Applet" Watch "Problems with Threads in an Applet" New topic
Author

Problems with Threads in an Applet

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Homework problem here, I'm creating an applet that draws 5 random lines on the applet. That's easy enough, got it all working good. However, just to challenge myself, I'm going beyond what the assignment wants and I decided to add a thread in here that will draw one line, sleep for a second, then draw another, etc. Thought it would "look" better than just the 5 lines all at once.
Anyway, when I added the thread part to the program, I no longer get any lines being drawn. I added some print statements that tell me where I am in my program, and it seems to be going through everything like it should, I'm just not getting anything printed out. I've used threads before in this same sort of context, but I can't seem to see why this wouldn't be working.
Any pointers would be great, don't worry about posting code
Thanks!
Jason
 
wood burning stoves
 
subject: Problems with Threads in an Applet
 
Similar Threads
drawRect() issues
I need experienced replies only regarding coding standards!
Braincramp regarding classes
Use of the "This" keyword, and "Point" objects.
What is going wrong??????? Help!!!