Skip to main content

NetBeans 6.1 JavaFx first test problem

2 replies [Last post]
fraer9
Offline
Joined: 2008-02-01
Points: 0

Hello,

I'm new to JavaFX. I use the plugin from http://deadlock.netbeans.org/hudson/job/JavaFX_NB_daily/

And the following script :

package javafxapplication2;
Frame {
content: Button {
text: "Press Me"
action: operation() {
System.out.println("You pressed me");
}
}
visible: true
}

And i have the following error as output in the ide :
init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\build\classes
C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\src\javafxapplication2\Main.fx:17: Sorry, I was trying to understand a suffixed expression but I got confused when I saw '{'.
action: operation() {
C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\src\javafxapplication2\Main.fx:18: Sorry, I was trying to understand an object literal part but I got confused when I saw '.' which is an operator.
Perhaps you are missing a ':'.
System.out.println("You pressed me");
C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\src\javafxapplication2\Main.fx:18: Sorry, I was trying to understand an object literal part but I got confused when I saw '.' which is an operator.
Perhaps you are missing a ':'.
System.out.println("You pressed me");
C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\src\javafxapplication2\Main.fx:19: Sorry, I was trying to understand the module contents but I got confused when I saw '}'.
}
C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\src\javafxapplication2\Main.fx:20: Sorry, I was trying to understand the module contents but I got confused when I saw '}'.
}
C:\Documents and Settings\Fraer\Mes documents\NetBeansProjects\JavaFXApplication2\src\javafxapplication2\Main.fx:21: Sorry, I was trying to understand an expression but I got confused when I saw ':' which is an operator.
visible: true
6 errors
BUILD FAILED (total time: 0 seconds)

I'm a little confused too :)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tball
Offline
Joined: 2003-06-10
Points: 0

The plug-in uses the new syntax, where "operation" was changed to "function". You'll also want to add an "import javafx.ui.*;" and "import java.lang.System;" lines after the package line, so the compiler knows which Frame, Button, and System classes to use.

Tom

fraer9
Offline
Joined: 2008-02-01
Points: 0

Thanks !

Also it would be great to have some automatic imports like in a classic Java editor !