File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes I need to synchronize a block of code... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "I need to synchronize a block of code..." Watch "I need to synchronize a block of code..." New topic
Author

I need to synchronize a block of code...

Chris Stewart
Ranch Hand

Joined: Sep 14, 2002
Posts: 184
I'm making a card game where I move cards around a few times each round. The card movements takes place in a thread. I keep getting java.lang.IllegalThreadStateException errors when my thread is trying to be executed while in progress already. Can anybody help me out here?
Here is the code that determines how many different movements there should be and finally calls the start on the moveCard Thread.
Chris Stewart
Ranch Hand

Joined: Sep 14, 2002
Posts: 184
Ah, nevermind. I just created a Thread that handles the movement. I made the moveCards method synchronized and everything was perfect.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I need to synchronize a block of code...
 
Similar Threads
Please help!!
Urgent help PLEASE
Problem clearing and resetting a JPanel
Why does this still flicker?
Not refreshing...