If you issue this statement:
try {
Class.forName("MyClass");
} catch(ClassNotFoundException) {
//if you arrive here, it means that your class will never
//be loaded because it is not in your classpath
}
execution will block untill class MyClass is loaded...
Hope it helps
Sorry, I forgot the exception variable name:
try { Class.forName("MyClass"); }
catch(ClassNotFoundException cnfe) {
//if you arrive here, it means that your class will never
//be loaded because it is not in your classpath
}
What you mean "if it was initiated"? Where do you plan to perform your test? Within the applet itself? I mean, if you put your code in the init() method, you know the applet is loaded; if you put your code in the start() method, you know the applet is starting; if you put your code in the paint() method, you know the applet is needed to repaint herself; if you are in another thread, well you should test some boolean property you'll set to true at the end of the start method. The same if you want to perform the test from outside the applet (in another applet or from javascript code).
Hope it helps...
> What you mean "if it was initiated"? Where do
> you plan to perform your test? Within the applet
> itself? I mean, if you put your code in the init()
> method, you know the applet is loaded; if you put your
> code in the start() method, you know the applet is
> starting; if you put your code in the paint() method,
> you know the applet is needed to repaint herself; if
> you are in another thread, well you should test some
> boolean property you'll set to true at the end of the
> start method. The same if you want to perform the test
> from outside the applet (in another applet or from
> javascript code).
>
> Hope it helps...
Within the applet. I just want to know if it was loaded.