Object.wait Method

Pauses a process.

Syntax

public void wait()

Run On

Called

Remarks

The most common use for this method is to start an object that asks the user for some input and then call the wait method on that object, such as a form. The next line of code is not executed until the object has called the notify or notifyAll method.

When the wait method is called from a form, you do not have to call the notify methods manually because forms call the Object.notifyAll method when the user either closes the form or presses the Apply button.

Note

This method is not meant for thread synchronization. Use the waitUntilSignaled method instead.

Examples

The following example opens the GetUserInput dialog, blocks, and waits until the user has closed the form.

{ 
    Args a = new Args("GetUserInput"); 
    formRun fr = new formRun(a); 
 
    fr.init(); 
    fr.run(); 
    fr.wait(); 
  
    // Execution will resume at this point, only after 
    // the user has closed the form. 
}

See Also

Reference

Object Class