How can I set a delay during execution

I'm writing an application that calls a function in an external API. This part of code is:

status = objController.unRegisterMarkup(this);

status = objController.registerMarkup(this);

I'm not getting it to work correctly, and I would like to have a pause or delay of about 1 sec, to get something like:

status = objController.unRegisterMarkup(this);

delay("1000");// pause 1 second

status = objController.registerMarkup(this);

maybe there is an easy function in java, but I just don't know what it is.

Thanks

[754 byte] By [RobertoZozayaa] at [2007-11-27 2:10:56]
# 1
Look at the static "sleep" method in the Thread class.
KathyMcDonnella at 2007-7-12 2:03:40 > top of Java-index,Core,Core APIs...
# 2
This topic was posted in the wrong forum. See http://forum.java.sun.com/ann.jspa?annID=14
PeterAhea at 2007-7-12 2:03:40 > top of Java-index,Core,Core APIs...
# 3
Make the following changes...status = objController.unRegisterMarkup(this);try {Thread.sleep(1000);} catch (Exception e) {}status = objController.registerMarkup(this);
sun_shaila at 2007-7-12 2:03:40 > top of Java-index,Core,Core APIs...