This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Thread Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thread Problem" Watch "Thread Problem" New topic

Thread Problem

erdem ozdemir

Joined: Aug 09, 2005
Posts: 15
hi all o/

I am not much experienced in threads, I have a problem in threads.

Here, I have a label which is like a button. When I call e.go(), I actually start a timer object in my extended label to start an animation in it. Here is the code that starts animation.

My problem here is that, it performs part in belowe before showing me animation. I think when I call sleep of thread in label object, it comes back to codes in panel and continues there. Then it completes animation but I can't see animation because panel of main screen has already changed.
am I right?

I could not find any solution to this so far. Any help will be appreciated in advance.


[ September 28, 2006: Message edited by: erdem ozdemir ]
[ September 28, 2006: Message edited by: erdem ozdemir ]
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24189

Let's see the code for "e.go()" before I tell you what's wrong. There are at least two possibilities that I can think of.

[Jess in Action][AskingGoodQuestions]
erdem ozdemir

Joined: Aug 09, 2005
Posts: 15

here is go part in extended label.
If i remove that if/else part in MouseClicked function, I can see animation which is actually a flash of colors.

Thanks in advance.
jQuery in Action, 3rd edition
subject: Thread Problem
It's not a secret anymore!