Open Source JavaFX Now!

JFXtras Samples Logo

Artifact
Default Tag Set

JFXtras Samples

The goal of the JFXtras Samples project is to provide quality JavaFX sample programs for users to learn and explore the language.  Please feel free to browse the samples, reuse any of the code in your applications (all licenses are commercial friendly), and contribute any additional samples you have back to the community.

« Back

JavaFX to JavaScript and Back

Untitled Document
Author:Carl Dea
Homepage:http://carlfx.wordpress.com/
License: New BSD License
Description:Demonstration of JavaFX and JavaScript interaction.
Tags: sample, animation, graphics, javascript
Modified:Mon, 06 Jul 2009 06:27:04 -0500
Launch Widget Browse Source Launch Widget Download Project


Here is an example of an HTML page with an embedded JavaFX applet with HTML form elements below for data input to create bouncy balls. The demo allows a user to specify the number of balls to add to the scene called the “Add balls to Scene” field.  When the “Add Ball(s)” button is pressed the JavaScript code will pass the number of balls to the JavaFX public script level function called addBalls() which will create bouncy balls.

Add balls to Scene :
Number of balls:

 

For more information see: http://carlfx.wordpress.com/2009/07/05/javafx-to-javascript-and-back-part-1/


Average (0 Votes)