Pausing in Java

S

Sharp

Hi

What class allows you to pause a Java application for any specified number
of seconds/minutes?

Cheers
Michael
 
A

Antti S. Brax

What class allows you to pause a Java application for any specified number
of seconds/minutes?

Please specify what you mean by "pausing a Java application".

Can we assume that the obvious Thread.sleep(long) is not what
you are looking for?
 
S

Sharp

Please specify what you mean by "pausing a Java application".

Can we assume that the obvious Thread.sleep(long) is not what
you are looking for?

I want to test the JProgressBar out.
I want to see the bars move to the end.
Using Thread.sleep() should do it

Cheers
Michael
 
T

Tony Morris

Sharp said:
I want to test the JProgressBar out.
I want to see the bars move to the end.
Using Thread.sleep() should do it

Cheers
Michael

a) You cannot pause for a specified amount of time. (You can only tell a
thread to step out of the running state for a specified period of time - the
point at which the scheduler puts that thread into the running state is
completely indeterminate)
b) "pausing" in the event dispatch thread implies a poor user interface
(try it and see).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top