Skip to content Skip to sidebar Skip to footer

How To Show Progress Bar When The Java Applet Load On Web Browser

I have a Jar File which run the applet. This Jar File is called by Call_Applet_Jar.html file which is in www directory. The Call_Applet_Jar.html file has a javascript and html co

Solution 1:

Please see Displaying a Customized Loading Progress Indicator:

A Java applet can display a customized loading progress indicator that shows the progress of download of the applet's resources as well as other applet specific data.

Solution 2:

You can't know with javascript or html when java applet loaded completely on browsers. To load applet on browsers.

1--> JVM should runned. 2-->The jar should downloaded and ran. 3-->The ready() method should access to page

All of them are not understood by javascript or html. You must call javascript function from java applet when applet is loaded completely on browser. Namely java applet should give notice to javascript side. In this way you can understand the applet is loaded completely on browser. The example code is below.

package example_package;
import netscape.javascript.*;
publicclassExample_Applet_ClassextendsApplet {
 publicvoidstart() {
        try {
JSObject calling_object = JSObject.getWindow(this);
//to call javascript method when the applet is loaded on browser completely..String passing_argument = "applet jar  is downloaded";
calling_object.call("javascript_function" ,  newObject[] {passing_argument});
//or you can set the javascript object when applet is loaded on browser completely..String assign_value_js_object = "loaded";
calling_object.setMember("js_object",assign_value_js_object);
} catch (JSException jse) {
            jse.printStackTrace();
        }

///**//Javascript Side//**///
<head>
<title>JavaScript Side</title><metahttp-equiv="Content-Type"content="text/html; charset=windows-1252"/><scriptlanguage="javascript">var js_object= "";
if(js_object == "loaded")
{
//The code which should ran when the applet is loaded completely on browsers.
}


//Called from java Appletfunctionjavascript_function(argument_came_from_java_applet)
{
//The code which should ran when the applet is loaded completely on browsers.
}


 </script>
</head>
<body>
...
</body>

Post a Comment for "How To Show Progress Bar When The Java Applet Load On Web Browser"