开发者

Java applet created in Processing doesn't run in Safari

I have an applet made开发者_如何学JAVA with Processing that doesn't run in Safari. I have been looking for help online, and changed to using "code" instead of "classid" in the object tag, because I read that Safari may not open any applet that includes the classid in the object definition.

The result seems to be running in Firefox, Chrome, and Internet Explorer, but still not in Safari. Now in Safari I get the outline of the applet window and a quick flash of the processing logo, which I wasn't getting before -- but that's it.

I have also tried using the "applet" tag instead of the "object" tag, but still no go.

Below is the body of my HTML.

<body>
    <div id="content">
        <div id="Working_SVGPuzzler8_container">

            <!-- This version plays nicer with older browsers,
                 but requires JavaScript to be enabled.
                 http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
            -->
            <script type="text/javascript"
                src="http://www.java.com/js/deployJava.js"></script>

            <script type="text/javascript">
                /* <![CDATA[ */

                var attributes = {
                      code: 'Working_SVGPuzzler8.class',
                      archive: 'Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar',
                      width: 800,
                      height: 600,
                      image: 'loading.gif'
                    };
                    var parameters = { };
                    var version = '1.5';
                    deployJava.runApplet(attributes, parameters, version);

                    /* ]]> */
            </script>

            <noscript>
                <div>
                    <!--[if !IE]> -->
                    <object code="Working_SVGPuzzler8.class"
                                type="application/x-java-applet"
                                archive="Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar"
                                width="800" height="600"
                                standby="Loading Processing software..." >

                        <param name="archive" value="Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar" />

                        <param name="mayscript" value="true" />
                        <param name="scriptable" value="true" />

                        <param name="image" value="loading.gif" />
                        <param name="boxmessage" value="Loading Processing software..." />
                        <param name="boxbgcolor" value="#FFFFFF" />

                        <param name="test_string" value="outer" />
                    <!--<![endif]-->

                    <!-- For more instructions on deployment,
                         or to update the CAB file listed here, see:
                         http://java.sun.com/javase/6/webnotes/family-clsid.html
                         http://java.sun.com/javase/6/webnotes/install/jre/autodownload.html
                    -->
                    <object
                        code="Working_SVGPuzzler8.class"
                        codebase="http://java.sun.com/update/1.6.0/jinstall-6u20-windows-i586.cab"
                        width="800" height="600"
                        standby="Loading Processing software..."  >

                        <param name="code" value="Working_SVGPuzzler8" />
                        <param name="archive" value="Working_SVGPuzzler8.jar,SoundCipher.jar,core.jar" />

                        <param name="mayscript" value="true" />
                        <param name="scriptable" value="true" />

                        <param name="image" value="loading.gif" />
                        <param name="boxmessage" value="Loading Processing software..." />
                        <param name="boxbgcolor" value="#FFFFFF" />

                        <param name="test_string" value="inner" />
                        <p>
                            <strong>
                                This browser does not have a Java Plug-in.
                                <br />
                                <a href="http://www.java.com/getjava" title="Download Java Plug-in">
                                  Get the latest Java Plug-in here.
                                </a>
                            </strong>
                        </p>
                    </object>
                    <!--[if !IE]> -->
                    </object>
                    <!--<![endif]-->
                </div>
            </noscript>

        </div>

        <p>
        </p>
        <p>
        </p>
        <p>
            Built with <a href="http://processing.org" title="Processing.org">Processing</a>
        </p>
    </div>
</body>


Care to share the Processing code with us? Other than that, it's a common problem. If you can possibly program the processing application in raw Java, then you'll be fine in Safari.


Does it also refuse to load when you export your sketch from the Processing IDE?

This generates the applet plus an index.html which loads up the sketch applet. If that doesn't work in a vanilla Safari (so no nightly WebKits etc.) then there may be a bug in Processing, and it'll be worth reporting it on the Processing issue tracker at http://code.google.com/p/processing/issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜