posted 17 years ago
Instructions for the first step using the Eclipse plugin -- from novice to novice.
Do a Hello World
=============
After installing the plugin, you won't see any change at all in the Eclipse interface except when you create the first JavaFX file. Create a new Java Project, and then Hello.fx in the source directory:
new | other... | javaFX | JavaFX File.
(The source directories are managed exactly like you would do with Java sources.)
When you add your first .fx-file in your Java project, the JavaFX plugin knows it should be a JavaFX-project, and adds the .jar files which are needed. It also knows that the run-configuration should now utilize the FXShell as main class.
The contents of Hello.fx may be something like this:
import javafx.ui.*;
import java.lang.System;
Frame {
content: Button {
text: "Press Me"
action: operation() {
System.out.println("You pressed me");
}
}
visible: true
}
You run it by right-clicking on the project (or the file you want to run) and add a new configuration for a �JavaFX Application�. It will have net.java.javafx.FXShell for Main class. You must add the name of the Hello.fx (or just the class name, �Hello�) to tell the shell what to run. (Otherwise, it compiles and run the empty set of classes without complaining: very annoying!)
The second step: run the demo application.
==============================
To run the demo application in Eclipe, you may use �demo.DemoLauncher� for argument to the FXShell.
You must also add the �demos� directory as a source directory along with �src�. You do that under Project | Properties | Java Build Path | Source. Otherwise, I didn't have to change anyting from what I got from the Subversion trunk (or the source download).
There's some Red in the Source: ignore it!
==============================
There is one spot in the code that the plugin complains about, but it worked anyway. Someone will remove that eventually... I guess.
This is the place causing it:
incompatible types: expected net.java.javafx.type.ValueList, found javafx.ui.canvas.Group
in new Group {transform: translate(30, 30), content: new ViewOutline {selected: true, view: widget, rectHeight: h, rectWidth: w}}
Tutorial Project/javafxpadJavaFXPad.fxline 980