The Artima Developer Community
Sponsored Link

Java Buzz Forum
An Updated JavaFX 2 Applet: Pythagorean Theorem

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
An Updated JavaFX 2 Applet: Pythagorean Theorem Posted: Apr 4, 2012 6:07 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: An Updated JavaFX 2 Applet: Pythagorean Theorem
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

Oracle announced the EOL (end of life) for JavaFX 1.2 and 1.3 36 days ago:

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.

Your browser does not support HTML 5 video. Here's the link to the video file.

Enjoy the elegance of geometry and JavaFX.

Read: An Updated JavaFX 2 Applet: Pythagorean Theorem

Topic: Study: Open source libraries propagate security flaws Previous Topic   Next Topic Topic: What is Akka?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use