This puzzler is mainly directed at the students of the free JavaFX with Passion! course, and it contains concepts that have been covered in the course so far. The first student in that course who submits a correct solution will be awarded a free token for the Pro JavaFX early access eBook. If you're not enrolled in that course, feel free to submit a solution to this puzzler as well, because I'll give a free eBook for the first correct solution from a non-JavaFX-with-Passion student as well.
This first puzzler is pretty simple, but future puzzlers will be increasingly difficult. Here are the requirements:
- As shown in the screenshot above, the JavaFX program must have a slider and some text that rotates when the slider is adjusted.
- The rotation will be from 0 to 360 degrees, depending on the position of the slider.
- The text will consist of the string "Angle: " followed by the angle of rotation.
- The text must have a bold font weight, and be blue in color.
- The point at which the text rotates must be at the center point (both horizontally and vertically) of the text.
To enter your solution, submit a comment to this blog post that contains the source code pasted into it. To validate that the code meets the requirements, I will compile and run it with JavaFX SDK 1.1. It must run without any code editing, and must meet the above requirements.
I will feature the two winners and their solutions in an upcoming blog post. Let the games begin!