468,773 Members | 2,285 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,773 developers. It's quick & easy.

time delay

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
1 11720
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.

Similar topics

12 posts views Thread by | last post: by
12 posts views Thread by Conrad | last post: by
8 posts views Thread by Craig Williamson | last post: by
reply views Thread by zhoujie | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.