Skip to main content

Compiler choking on "attribute" keyword

2 replies [Last post]
kcbaltz
Offline
Joined: 2005-04-04
Points: 0

I just started testing the waters with JavaFX today and I'm running into some issues. Primarily, it's hard to tell which software I should be using since the official SDK isn't out (I signed up for the preview Friday, haven't heard anything yet). Here's one problem I'm having so far:

Several of the sample .fx files I've found on the net contain code with the "attribute" keyword. All of my JavaFX compilers are complaining about it includin : the NetBeans 1.1.0 JavaFX plugin the OpenJFX compiler releases from March 3, 2008 and May 19, 2008. I'm running NetBeans on Java 1.6.0_06, but some of my command line stuff may have run with 1.5.

The specific error message is like the following:
Sorry, I was trying to understand the module contents but I got confused when I saw 'attribute' which is a keyword.

Where am I going wrong?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12
Points: 0

I can guess that you have found the examples written on interpreter version of JavaFX Script language. If so, you can use Script Programming Language Reference to study syntax of the compiler version: http://openjfx.java.sun.com/current-build/doc/JavaFX-Language.html

tball
Offline
Joined: 2003-06-10
Points: 0

Attributes are data members of classes, so the keyword "attribute" is only valid within a class declaration. To declare a variable outside of a class (including variables in functions), use "var".