Chris Oliver's Weblog

Wednesday Jan 07, 2009

JavaFX Script Keywords and Java Interoperability

In JavaFX script any sequence of characters enclosed in "french quotes" is treated as a lexical identifier, and thus may be used as a valid name of a variable, function, or class.

  var <<this is a variable>> = "Hello World";
  <<this is a variable>>.toUpperCase();

This mechanism may be used to access Java methods which conflict with JavaFX keywords, for example:

  var textArea = new javax.swing.JTextArea();
  textArea.<<insert>>("Hello World", 0);

This mechanism is also useful for code generators in translating symbols from other languages having incompatible lexical rules to JavaFX script.

Comments:

Ah, interesting! I've seen those in various examples before, but didn't know what they were. Thanks for the explanation!

Posted by Gaz on January 08, 2009 at 10:53 AM PST #

insert(..) for JTextField???
It's interesting to see that creator of JavaFX doesn't know Java :-)

Posted by bartec on January 12, 2009 at 05:34 PM PST #

@bartec

I've corrected the example. Thanks for pointing it out.

Posted by Christopher Oliver on January 13, 2009 at 10:13 AM PST #

@christopher

I know I'm little boring and you have more important and interesting things to do, but .. it's still incorrect.
There is no method insert(String) for JTextArea.
BTW I feel you really don't like Swing. Is it a main reason we have now so fascinating and so Swing-alien JavaFX?

Posted by bartec on January 13, 2009 at 04:34 PM PST #

@bartec

Thanks again for quality-assuring my blog entries.

Posted by Christopher Oliver on January 13, 2009 at 07:24 PM PST #

http://www.Sohbetizm.Net
Thank You VEry Much.. VEry Good Index..

Posted by çet on May 18, 2009 at 04:16 AM PDT #

http://www.smsmatbaa.com

Posted by matbaa on June 22, 2009 at 10:00 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Feeds

Search

Links

Navigation

Referers