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 02: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 09:34 AM PST #

@bartec

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

Posted by Christopher Oliver on January 13, 2009 at 02: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 08:34 AM PST #

@bartec

Thanks again for quality-assuring my blog entries.

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

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

Posted by çet on May 17, 2009 at 09:16 PM PDT #

http://www.smsmatbaa.com

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

Simple and Nice example !

Posted by شات on December 15, 2010 at 03:58 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

user12610627

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today