Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Java web browser component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java web browser component




On Aug 29, 2005, at 5:42 PM, Doug Zwick wrote:


On 29-Aug-05, at 2:12 PM, Michael Hall wrote:


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 any curiosity in having a look...

http://www.spacestar.net/users/mikehall/webkitjava.jar

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.

Mike Hall        email@hidden
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



_______________________________________________
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


References: 
 >Re: Java web browser component (From: Doug Zwick <email@hidden>)
 >Re: Java web browser component (From: Michael Hall <email@hidden>)
 >Re: Java web browser component (From: Doug Zwick <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.