Solved

Applet loading progress meter for java1.1

Posted on 2001-08-20
5
211 Views
Last Modified: 2013-11-23
I have a largish applet with images that at present is stored in a signed cab file.

I wish to have a progress indicator so that the users
can see something happening.

This is similar to another question posed a few months back which objects answered

However I am using java1.1 and objects answer would not work as it uses URLClassLoader (not available on 1.1 I reckon)

ANother proposed answer (from matt c) was :

- get a certificate and overrride the ClassLoader to load all your classes. On each download of a class,
you will update your progress bar.


Could anyone enlighten me please

Ideally I would want to get the progress indicator up asap
then pull in a jar file with say 50K of classes or images
and update the progress indicator
repeat the above 9 more times and it's done..
And the browser would need to cache the pulled in Jar files ...



0
Comment
Question by:PhilAllen
  • 2
  • 2
5 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6408063
I gave another suggestion as well (but it may have been in a different question).
It related to including just your progress bar in the main jar, and then loading 'real' main class using reflection.
This will mean the jar holding your application are not loaded initially.
0
 
LVL 92

Expert Comment

by:objects
ID: 6408078
Something like this. The important thing is that the loader applet has no references to any classes in your main jar.

public class AppletLoader extends Applet
   implements Runnable
{
        private String mainClass;

        private void loadApplet(String cn)
        {
            // Start up a thread to load main applet
            mainClass = cn;
            new Thread(this).start();
        }
       
        public void run()
        {
            try
            {
                // Instantiate the main class
                // This will cause the browser to download
                // required classes.

                Class c = Class.forName(mainClass);
                Component comp =(Component)c.newInstance();
                add(comp);
             }
             catch (Exception e)
             {
                 e.printStackTrace();
             }
       
             invalidate();
             validate();
         }
       
         public void init()
         {
             // start up your progress bar                
             loadApplet("MyApplet");
         }        
    }
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 6428866
> I have a largish applet with images

I. put ALL RESOURCES in different .zip file that you can download yourself. this solution works

II. you can try 'playing' with several archives with .class file. first .zip file will contain main AppletLoder class + some helper class (progress bar etc). second .zip file will contain the 'applet extension' class + everything else. main applet (AppletLoader) is supposed to trigger donwloading of the second .zip file with Class.forName(extensionClassName).

this works in IE, it seems that some (all ??) versions of NN download all the .zip files before instantiating the applet.

III. you can use two applets, inter-applet communication + JavaScript, but it'll be probably be quite tricky to make it working in all browsers ...
0
 

Expert Comment

by:SpideyMod
ID: 8615334
A request for a refund was made, however since the questioner did not do as instructed, it was denied.  I need the experts to indicate a method of finalization.  I will return in 72 hours.  Thanks.

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8650774
PAQ'd and points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 IE Certificate Issue 10 51
hibernate example issues from command prompt 10 50
null output 3 35
Bot application - advice 3 38
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question