Java Reference
In-Depth Information
<taskdef name="javafxc"
classname="com.sun.tools.javafx.ant.JavaFxAntTask"
classpath="${javafx.lib}/javafxc.jar" />
<target name="compile" >
<javafxc srcdir="." destdir="."
includes="*.fx" classpath="."
executable="${javafx.bin}/javafxc"/>
</target>
</project>
To build the first application, change the directory to the directory where you
saved the MyFirstApp.fx file, copy or save the build.xml file to this directory,
and then execute the ant command:
bash-3.2$ ant
Buildfile: build.xml
compile:
[javafxc] Compiling 1 source file to /export/home/jclarke/
Documents/Book/FX/code/Chapter1
BUILD SUCCESSFUL
Total time: 1 second
bash-3.2$
Eclipse
If you prefer to use the Eclipse IDE, you need to first download and install the
JavaFX SDK for your environment from http://javafx.com. Next, you need
Eclipse 3.4 or later; Eclipse IDE for Java EE Developers is recommended.
Lastly, you need to download and install the Eclipse plug-in for JavaFX from
http://kenai.com/projects/eplugin. To install the Eclipse plug-in for JavaFX, just
unzip it in the directory where Eclipse is installed. For example, if Eclipse is
installed in C:\Program Files\eclipse, unzip the Eclipse plug-in for JavaFX from
the directory, C:\Program Files.
To create your first JavaFX project, launch Eclipse. From the workbench space
under Project Explorer, right-click and select New | Project. Figure 1.9 shows
the New Project menu selection.
Next, create a Java Project by selecting Java | Java Project from the New
Project wizard. Figure 1.10 shows this window with the selections.
Name the project—for example, MyFirstJavaFXProject. Figure 1.11 shows the
Create a Java Project window with the project name entered.
 
Search WWH ::




Custom Search