Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect when an Applet is loaded

How can I detect whether a java-applet has been loaded successfully without polling the browser /using setTimout ?

Is there any event that I can bind to?

The problem is: there is a pop up asking the user whether he trusts the applet or not, and that takes a few seconds until the user clicks "Yes" ,meanwhile my code fails to execute because the applet has not been loaded.

like image 891
Lydon Ch Avatar asked Sep 17 '10 08:09

Lydon Ch


1 Answers

You mean from javascript ? You can ask the applet. Have it set a boolean to true in init(), and return this in a method you call ... oh wait, you wrote "without using setTimeout". Well, in this case, I guess you have to go the other way around, and have your applet call a javascript method (for instance with JSObject.getWindow(this);)... But I think this is more difficult/bug prone than using a timer until the applet is loaded.

like image 175
Damien Avatar answered Oct 23 '22 22:10

Damien