« Compiled JavaFX if/else - Is it a Statement or an Expression? | Main | Puzzler4Compiled (JavaFX Puzzler 4) Results and Sample Solution »

November 28, 2007

Comments

Shakir Gusaroff

Hi Jim, here is the "compiled" version.

import java.lang.*;
class Puzzler4Compiled {
attribute changingText: String = "changingText was replaced with" on replace { System.out.println( changingText ); };

}
var example = Puzzler4Compiled {};
example.changingText = "Hello";

Jim Weaver

Shakir,

This JavaFX Puzzler requires writing a *compiled* JavaFX Script program (see the first sentence of this post). Please see the following post for details on how to obtain the JavaFX compiler in its current form: http://learnjavafx.typepad.com/weblog/2007/11/compiler-cheat.html

Other recent posts cover some of the syntax changes for the compiled version.

Thanks,
Jim Weaver

Shakir Gusaroff

import java.lang.*;
class Puzzler4Compiled {
attribute changingText:String;

}

trigger on Puzzler4Compiled.changingText[oldValue] = newValue {
System.out.println( "{oldValue} {newValue}" ) ;
}


var x = Puzzler4Compiled {changingText:"changingText was replaced with" };
x.changingText = "Hello";

The comments to this entry are closed.

Categories