Java Reference
In-Depth Information
width: msg.boundsInLocal.width
height: msg.boundsInLocal.height * 2
scene: Scene {
fill:Color.BLUE content: [msg]
}
}
2. Next, compile and package the application using the javafxpackager tool (or your
favorite IDE). This will generate the JNLP, JAR file, and the HTML files used to deploy
the application as a Web Start or as an applet.
javafxpackager -src src -appClass params.RuntimeArgsApplet
-appName args-demo
-appVendor "Vladimir Vivien" -appVersion 1.0
-appCodebase "http://my.server/path/to/app /"
-appWidth 640 -appHeight 75
3. To set the runtime parameter value for the Web Start application, edit the generated
JNLP file, and add the <argument> tag in the <application> block as shown:
<jnlp>
...
<application-desc
main-class="com.sun.javafx.runtime.main.Main">
<argument>MainJavaFXScript=param.demo.Main</argument>
<argument>name=World</argument>
</application-desc>
...
</jnlp>
If you are going to run the application as an applet, you have to set the parameter
from within the bootstrap JavaScript code that launches the applet. Modify the
JavaScript snippet generated during the build/packaging step as follows:
<script>
javafx(
{
archive: "param-demo.jar",
width: 400,
height: 100,
code: "param.demo.Main",
name: "param-demo"
},
{
name: "World"
}
);
</script>
 
Search WWH ::




Custom Search