473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 11986
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: | last post by:
I've trolled the lists, FAQs, and Net as a whole, but can't find anything definitive to answer this. We're looking for real-time graph capability (bar, line, etc), so that we can display...
12
by: Conrad | last post by:
Greetings, Q: Is there some way to gracefully suspend a python app for a second or so then resume? I could write the classic basic dumb loop-tenzillion-times delay, but that seems inelegant, and...
18
by: Max | last post by:
This is a follow-up on my previous thread concerning having the program wait for a certain date and time and then executing some code when it gets there. My question is; can I use the Sleep...
18
by: barry | last post by:
I'm having a problem creating a delay before each list item gets moved ( http://www.polisource.com/PublicMisc/list-splitter-timeout-bug.html ). Choose any number of columns, vertical layout, and...
12
by: Spitfire | last post by:
I've a requirement to find the elapsed time between two function calls. I need to find the time elapsed accurate to 1 millisecond. The problem I'm facing right now is that, I'm using the 'time()'...
0
by: bdtmike | last post by:
I'm using VS2005 and creating a VB.Net Winforms app. The app uses a couple of web services. For some reason, when I start the app, there is a 30 second delay when VB invokes its first web service....
0
by: jayasakthi | last post by:
when we freeze the columns of a table in jsp, there is a time delay in scrolling the page. when we unlock the columns the time delay is not there. is there any solution for decreasing the time...
0
by: AndySummers | last post by:
Hi We have just re-written a majour asp.net project to use a user control embedded in a web page. The main dll references 3 other custom controls and so to deploy the project I copy the 4 dll's to...
1
by: klmishraa79 | last post by:
i want to know how i can put a time delay between two command execution...i.e. after first command of programm the second command should execute after some fixed delay......i want to use time delay...
8
by: Craig Williamson | last post by:
I'm trying to write a time delay loop in Borland C 3.1 (for legacy code) which has an accuracy of about 0.1ms. This change is due to a hardware change and the software is now running too fast to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.