Search code examples
appletjavafx

Placing a JavaFX Applet into an HTML Page


How can I place a JavaFX applet into an html page that doesn't use SUN's Javascript?

<script src="http://dl.javafx.com/1.2/dtfx.js"></script>

I.e. I want something like

<APPLET CODE="AppletSubclass.class" ARCHIVE="file1, file2"
    WIDTH=anInt HEIGHT=anInt></APPLET>

I tried using the com.sun.javafx.runtime.adapter.Applet class in my script, but I didn't understand how to use it because it hasn't any appropriate instance variables to hold a scene. This is my test script: ![alt text][1]

https://s47.radikal.ru/i115/0907/5a/60e5f3be9aa3.png

I'm using JavaFX version 1.2.


Solution

  • take a look at this blog entry. There you can see the applet tag which is generated by the javascript. Though it uses JNLP and not the old-fashioned applet style. Does this help? By the way, why don't you want to use the JS?

    EDIT: See this article http://blogs.oracle.com/mobility_techtips/entry/how_to_develop_and_run about how to run applets in a closed intranet. As you will see its not very convenient, and comments show that people are not really happy with it. But it should work.