Does thread.sleep() pause keylistener?

I have an applet that I want to pause for 4 seconds while something is displayed. When I try using thread.sleep() it seems to pause the thread... but it doesn't pause the key listener and what ever was pressed during the pause will be executed after the pause is over. Is there a way that I can stop the key listener while the thread is paused?

[352 byte] By [Mr_Smileya] at [2007-11-27 10:18:28]
# 1

One more thing. I am using the methods keyUp and keyDown which I guess are deprecated. Do you think this has anything to do with the problem?

Mr_Smileya at 2007-7-28 16:29:03 > top of Java-index,Desktop,Core GUI APIs...
# 2

I am still having this problem. I tried adding a boolean to check if the thread is sleeping like so:

running = true;

thread.sleep(3000);

running = false;

Then in my keylistener methods I tried:

if(!running)

exec...

But that did not work either. Is there any way to check if a thread is sleeping?

Can I please get some help here?

Mr_Smileya at 2007-7-28 16:29:03 > top of Java-index,Desktop,Core GUI APIs...