T
tekinico
Hi there !
I'm having issues to make my applet running correctly !
Situation: I have one html page with an applet tag to run an applet
called "Monitor" (Monitor.class). This class is in the same directory
on the server, so i don't have any problem with, it loads.
My problem is that this class Monitor dynamically loads another class
and displays it in the Monitor panel :
Class simulatorClass = Class.forName(simulatorClassName);
simulator = (Applet)simulatorClass.newInstance();
The problem is that this "Simulator" class is not in the same folder on
the server.
So, first i tried to give the loader a url and try like that :
URLClassLoader loader = new URLClassLoader(new URL[] { new
URL("http://lblablabla.com/appletFolder/") });
// Load class from class loader.
Class c = loader.loadClass (simulatorClassName);
// Create an instance of the class just loaded
simulator = (Applet)c.newInstance();
But for some security reasons, the jvm on the browser machine doesn't
allow this.
Question: How can i do to load my applet in a different folder ?? I've
been trying every possible option with the codebase and archive
attribute on the html page as well, but wihtout success !!
Thanks in advance !
Nico
I'm having issues to make my applet running correctly !
Situation: I have one html page with an applet tag to run an applet
called "Monitor" (Monitor.class). This class is in the same directory
on the server, so i don't have any problem with, it loads.
My problem is that this class Monitor dynamically loads another class
and displays it in the Monitor panel :
Class simulatorClass = Class.forName(simulatorClassName);
simulator = (Applet)simulatorClass.newInstance();
The problem is that this "Simulator" class is not in the same folder on
the server.
So, first i tried to give the loader a url and try like that :
URLClassLoader loader = new URLClassLoader(new URL[] { new
URL("http://lblablabla.com/appletFolder/") });
// Load class from class loader.
Class c = loader.loadClass (simulatorClassName);
// Create an instance of the class just loaded
simulator = (Applet)c.newInstance();
But for some security reasons, the jvm on the browser machine doesn't
allow this.
Question: How can i do to load my applet in a different folder ?? I've
been trying every possible option with the codebase and archive
attribute on the html page as well, but wihtout success !!
Thanks in advance !
Nico