Welcome!

AJAX & REA Authors: Jonny Defh, RealWire News Distribution, Brandon Watson, John Savageau, Paul Miller

Related Topics: AJAX & REA

AJAX & REA: Article

Jim Weaver's JavaFX Puzzler: The Puzzler4Compiled Program

First Correct Solution Gets Free JavaFX Script eBook

From Jim Weaver's Learn JavaFX Weblog

As I mentioned in my post a week ago, this JavaFX Puzzler will require writing a compiled JavaFX Script program. In subsequent posts on my Learning JavaFX weblog, I've provided instructions for using the OpenJFX Compiler to compile a JavaFX Script program into Java bytecode, and to run the program. If you haven't seen these posts, please review them first.

The first person to post a comment with a correct solution will be given a free JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications eBook (PDF download).  When submitting your answer, be sure to put your correct email address in the "Email Address: (Not displayed with comment.)" text field on the comment form so that I can contact you with the information to obtain your free eBook.

Requirements for Puzzler 4: The Puzzler4Compiled Program

Here is the console output of the sample solution:

changingText was replaced with Hello

The requirements for this program are as follows:

  1. The console output must be the same as shown above

  2. The program must define a class named Puzzler4Compiled that has an attribute named changingText that is of type String.

  3. The changingText attribute must have an on replace trigger that prints "changingText was replaced with" followed by the new value of the changingText attribute.

  4. An instance of the Puzzler4Compiled class must be created, setting the value of the changingText attribute to "Hello".  This causes the trigger to be executed, and the output shown above to be printed on the console.

Have fun with this JavaFX Puzzler!

More Stories By James L. Weaver

James L. (Jim) Weaver is founder and president of jMentor, formed in 2000 to provide Java programming-related training to companies and individuals. He has served as a system architect and developer for over 25 years, specializing in leading-edge software development. His specialties include Java, object-oriented, and web-based technologies. He has authored books on the Java programming language, including most recently JavaFX Script, published by Apress.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.