Quote:
Originally Posted by priyaraji
I am just starting my hands on threads in Java. I want to mention that only one thread should execute the method at a time. Is this possible. How can I do this.
|
U can Do that. For execution of only one Thread special methode given by the JAVA that is " SetPriority " . U can set the Priority of the Thread. For that priority Only the specific Thread will be Executed. And start that Thread in for( ; ; ) Loop, call the Thread.sleep(); outside that loop. So that Loop never end and Thread doesn't stop.
Try this.... By using this u can do the prg. of Moving Banner also.