You need to have some classes providing the AppletContext to do it
from java. I did a little messing with that based on a java world
example. For most simple purposes it allowed running applets.
Actually commandline although I never really got into handling
parameters correctly...
Dmitry hacked in basic applet support by respawning the
JVM running the application with a tweaked classpath.
This obviously is not a universal solution, but it does
work for some cases.
I made a rough try at getting mine to work, running the applet from
the original and single jvm. I wouldn't exactly call it universal, or
bug free. But I have at least one case where it works so maybe the
potential of being an alternative.
I made the WebPreferences change you mentioned so that gets set to
not having java enabled. I thought when I messaged it to start out it
showed initially as set on but changed after running my code to
initially show as off. It didn't change anything as far as Safari
goes, so not that big a deal.
Otherwise, I scan the page for applet tags, if I find one I set up a
URLClassLoader with the pages parent and applet's archive URL's, and
then try to run the applet in a class called AppletRunner, variation
of the 'run' class I mentioned earlier. AWT instead of Swing for one
thing. I wasn't real sure what might be best for threading concerns.
So far it really doesn't work well enough to matter much, it seems
trickier running this stuff actually off the web. I don't think I've
had one work there yet. I did get one of mine to work when run
locally, so that was sort of a proof of concept anyhow. I think it
crashes the second time around on hitting an applet so not much more
than that as-is.
For the graphically inclined, like Dmitry, what I think might be more
cool would be if you could offscreen the java applet drawing, convert
that to an NSImage or something and draw it directly into the
CocoaComponent where the applet should actually be. I decided against
trying that part myself for now.
If you think it might make a valid option if it actually worked I
might look at getting it to do so a little more successfully. I might
sometime anyhow. Sort of interesting.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden