By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

time delay

P: n/a
I have a whole lot of if statements for checkboxes that play sounds if they
are selected (an example is as follows) but i want a delay between when each
if statement is played. How do i put a time delay between these?

if (checkbox1.isSelected())
Base.play();
if (checkbox2.isSelected())
Base.play();

thanks
matt
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
thanks i worked it out now
"A Bag Of Memes" <a@b.c> wrote in message
news:vD********************@twister.austin.rr.com. ..

"webster" <tr********@hotmail.com> wrote in message
news:Nj*****************@news-server.bigpond.net.au...
I have a whole lot of if statements for checkboxes that play sounds if

they
are selected (an example is as follows) but i want a delay between when

each
if statement is played. How do i put a time delay between these?

if (checkbox1.isSelected())
Base.play();
if (checkbox2.isSelected())
Base.play();


You can call Thread.sleep() if the code above isn't in the GUI event
handling thread. One possible solution is to add play commands to a queue
and have a dedicated sound playing thread that dequeues commands, plays
sounds and waits between them.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.