• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaFX Code On Jim's Blog

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim, I've been trying to run some of the code on your blog but have at times ran into interesting issues. One small example is this code. I get errors regarding the var firstName:String and basically any 2nd var declaration.

Another example is the following code:

var firstNameRow = Row { alignment: Alignment.BASELINE }

JavaFX complains that Alignment only allows id and name attributes. But changing it to:

var firstNameRow = Row { alignment: BASELINE }

works just fine. In fact, all the code examples from the openjfx site as well as the JavaFX Planet site work just fine. What I am wondering is if you have been using a more cutting edge version of JavaFX and if so what is the best way to go about getting that and it being able to work with existing tools? It is very confusing right now.
 
author
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are two versions of JavaFX: The interpreted version served as a prototype. That is most likely the version that you are using. The "real" version of JavaFX Script is the compiled version, which compiles to JVM bytecode. You can compile and execute compiled JavaFX Script programs from the command line, or using the NetBeans 6.1 (currently beta) IDE with the JavaFX Plugin. Please see the Creating Rich Internet Applications With Compiled JavaFX Script Technology tutorial (first in a series that I'm writing for java.sun.com) to learn how to obtain the JavaFX Script compiler and begin developing compiled JavaFX Script apps. By the way, the "Compiled JavaFX Script" category of my weblog contains compiled (as opposed to interpreted) JavaFX Script examples.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would one syntax work in one and not the other? This seems bad to me. I'll go read that link, maybe I am just missing something. But take Groovy for example. Interpreted or compiled, it is the same script.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just came back to ask something else about this and re-read your response:

The interpreted version served as a prototype. That is most likely the version that you are using. The "real" version of JavaFX Script is the compiled version, which compiles to JVM bytecode



I still think it is confusing that this was done but I think I understand now. The only problem is how do you know for sure the code you are looking at that is scattered around the web is for the compiled version or the "prototype" version? I can imagine this being very frustrating.
 
James Weaver
author
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a valid concern. If the JavaFX Script program has the "operation" keyword, it's interpreted, because the compiled version combined "function" and "operation". Also, static variables used as constants are a give-away (e.g. Color.RED). The Rosetta Stone post contains some other differences. It also contains a link to a nice PlanetJFX article on the subject.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wonderful. Thanks Jim.
 
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic