javafx4you: Today, we are announcing that JavaFX 1.2 and JavaFX 1.3 will reach end of life (EOL) on December 20, 2012. More specifically, the Oracle server providing access to the JavaFX Runtime for these versions will no longer be available after that date.
So I spent some time in the last couple of days to update one of my JavaFX 1.1.1 applets published on this blog—an animation that depicts a proof of the Pythagorean Theorem. It appeared in Zhou Bi Mathematical Manual (周髀算经) which I wrote 1061 days ago. I wanted to update this applet because people have told me that it helped them or their kids to understand the Pythagorean Theorem better.
JavaFX 1.x code, which is in JavaFX Script, translates easily into JavaFX 2.0 code, which is simply Java. The two facilities of JavaFX 1.x that made the original applet work, bindings and animations, are major APIs in JavaFX 2.0. And the porting is almost mechanical. Naturally the Java code is more verbose than the equivalent JavaFX Script code. But that's the price we pay for converting JavaFX into the wider-reaching Java APIs.
While I was at it, I added a background image that was merely put side by side with the applet in the original post. Since JavaFX 2.0 applets only works on Windows, I have put the applet on a separate page here. The source code is here. The background image is here. The following is a video showing the applet at work. Notice the actual jpg file is bigger than the applet's Stage size. I used a viewport on an ImageView to pick out a portion of the image.