This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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

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: 24187

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.
GeeCON Prague 2014
subject: Thread Problem