i am working on a Java application and i reach a point where i want to pause the execution for few seconds ( chosen by the user ) and resume it latter ..and here is a simple code :
Public Class myApp
{
static public main()
{
int seconds=10;
// do couple of things
try {
Thread.sleep(10*1000);
} catch (InterruptedException ex) {
Logger.getLogger(myApp.class.getName()).log(Level.SEVERE, null, ex);
}
}
i want now to give the user a chance by clicking on a button to resume the execution even before the time is up . is this possible using "Thread.sleep()" ? or there is another way to pause App and resume it ?