A set of simple examples to show what can be done in Java with the JSweet transpiler.
All these example are written in Java using the JSweet APIs (candies)] They are then transpiled to JavaScript by the JSweet transpiler.
canvasdrawing
): demonstrates the use of HTML5 canvas. browseinputcontrol
): demonstrates the use of HTML5 forms and inputs. browsejquery
): demonstrates the use of JQuery with JSweet. browseangularjs
): demonstrates the use of Angular with JSweet. browseknockoutjs
): demonstrates the use of Knockout with JSweet. browseraytracer
): draws a 3D scene, adapted from the TypeScript example page. browsetodomvc
): demonstrates the use of Backbone and Underscore with JSweet, adapted from the TypeScript example page. browseblocksgame
): demonstrates how to write an HTML5 mobile game with JSweet. browsepromises
): demonstrates the use of the latest EcmaScript6 Promise API. browseVisit the live JSweet's example page (http://www.jsweet.org/examples) to browse the examples, run them and debug the Java code within your favorite browser. Note that all these examples are responsive and should work as well on a Web browser and on a mobile.
Visit also https://github.com/cincheo/jsweet-examples-threejs for some examples using the Threejs framework (WebGL-powered 3D)]
> git clone https://github.com/cincheo/jsweet-examples.git
> cd jsweet-examples
./gradlew jsweetClean jsweet (--refresh-dependencies) (--info)
mvn clean generate-sources
ant
> firefox webapp/${example-name}/index.html
The node
and npm
executables must be in the path (https://nodejs.org)]
Install Maven (https://maven.apache.org/install.html)]