Putting a SwingWorker thread to sleep

Is there anyway to put a SwingWorker thread to sleep from within the doInBackground method? I have tried the Object.wait(long timeout) method but keep getting an IllegalMonitorState exception.
[199 byte] By [mruna] at [2007-11-27 4:09:10]
# 1

I was forgetting to syncronize this works

publice Vector doInBackground()

{

// do some work here

synchronized(this)

{

try

{

wait(5000);

}

catch(Exception ex){}

}

Message was edited by:

mrun

mruna at 2007-7-12 9:14:34 > top of Java-index,Desktop,Core GUI APIs...