Xeno Campanoli wrote:
>And after fiddling with it the applet tag no longer bombs out my page:
>
><applet code='PauseHack.class' codebase='http://somevalidurl'
>name='pausehackhandle'></applet>
>
>And the javascript I'm calling it with is as follows:
>
> document.pausehackhandle.sleep(numberMillis);
>
>This seems all right, but somehow I'm still not getting the sleep. Does
>anyone see the source of my mistake? I'm stumped, but I'm afraid there's
>some subtle thing with my Java threads code in the second example above.
When you say "I'm still not getting the sleep", can you describe what *IS*
happening? Does the call itself fail? Does it always return immediately?
Does something else happen?
I see nothing obviously wrong with your code. To find out what it's being
called with, try this:
public void sleep(int milliseconds) {
try {
System.out.println( "At: " + System.currentTimeMillis()
+ " before sleep: " + milliseconds );
System.out.flush();
Thread.currentThread().sleep(milliseconds);
System.out.println( "At: " + System.currentTimeMillis()
+ " after sleep: " + milliseconds );
System.out.flush();
} catch (InterruptedException iex) {
iex.printStackTrace();
}
}
Also, have you looked at your browser's console log to see if there are any
InterruptedException stack-traces?
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden