The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Single Thread Multiple Objects

Posted by Dan C on November 09, 2000 at 8:11 PM

I'll try and make this simple. I have a JAVA applet in which three objects are moving around. The Thread program is runnable and calls my Object program to create the motion for each object. Here is my problem, which even my teacher does not understand. The program works with one Thread declared but only if I don't try and eliminate the flicker (using OffscreenImage) from each object. When I add the code to eliminate the object's (e.g. circle) flicker using a single Thread, it runs for about 20 seconds then locks up the PC. I can get around this problem by adding two additional threads (one for each object). So, my question is can I design a single threaded program with multiple objects that produces no flickering?

I hope this made sense. Any help would be greatly appreciated.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us