Eclipse plugin for JavaFX Script
In addition to the support for JavaFX Script in the NetBeans IDE, there is also an Eclipse plugin. Developers can now kick the tires of this new extension of the Java platform in their favorite IDE. At a glance the Eclipse plugin is not as sophisticated as the NetBeans one, however the deployment support is invaluable. One can build and application and just before deploying it, can choose to do this in the browser, desktop or the mobile emulator.
Users should download the official documentation. More advanced users could use the instructions below:
Table of content
- Installation
- Install JavaFX SDK
- Install Eclipse
- Install Plugin
- Hello World
Installation
Download and install the JavaFX SDK for Windows or Mac Os X.
Install Eclipse
Plugin require Eclipse 3.4 or newer. We recommend downloading Eclipse IDE for Java EE Developers
for
Windows or
Mac OS X. Then follow the installation instructions.
Install plugin
- Download plugin:
- Unzip into eclipse installation directory
- There should be new files in
ECLIPSE_ROOT/pluginsandECLIPSE_ROOT/features - Run Eclipse
Hello World
Creating JavaFX Project and configuring JavaFX SDK
-
Start eclipse. You will see the basic layout of workbench.
-
In Package Explorer view click right mouse and select
-
Create new JavaTM project.
-
Name it
MyJavaFXProject
and press button. The new project appears in Package Explorer.
-
Open project popup menu and select .
-
The JavaFX perspective is activated. If this is first time you are adding
JavaFX nature into Java Project you will be asked for setting up
JAVAFX_HOMEproperty.
To set upJAVAFX_HOMEproperty follow steps bellow:- Press on message dialog. No thanks, I preffer button.
-
You should see dialog below with
JAVAFX_HOMEset to(empty)
value.
-
Press button on right side to bring up edit window.
-
Select button and select installation folder of JavaFX SDK.
-
Press on Folder Selection dialog,
press on Edit Variable Entry dialog.
-
Press on Preferences dialog.
The
JAVAFX_HOMEvariable has been set up.
-
Voila! you have first JavaFX Project.
Adding files
-
Expand MyJavaFXProject. Left click on src folder.
Then select and type into
package name com.sun.eclipse.example.
-
Left click on src/com.sun.eclipse.example folder.
Then select .
-
The New File wizzard will appear.
Type Main into field.
-
Press button and empty new JavaFX script is created.
-
Let's focuse on Snippets view. There is a lot of code snippets to help you develop
your application. Expand and select
Stage.
-
Drag into editor window and drop. The Insert Template: Stage
dialog appers. Change title into Hello World!.
-
Press button to insert template result into source code. Done
Running
Running application in Eclipse is very easy.
-
Press button on toolbar to lunch application.
-
If you are running first time the Edit Configuration dialog appears.
All options are setup to default values. The most interesting part is option. Here you can set up execution environment. Possible options are:- Desktop profile - Run as Application
- Desktop profile - Run as Applet
- Desktop profile - Run with WebStart
- Mobile Profile[?] - Run in Emulator
-
Press Run to start application. The console window will appear notifying you about progress of execution.
Building
Building is in Eclipse platform provided automatically. For more building options open menu
Configuration options
-
Select project in Package Explorer, right click and select
.
-
The Properties dialog appears. Select .
Here you can edit several default parameters used during execution and deployment process of JavaFX Project. For more information about meaning of available options see JavaFX Packager Documentation.
JavaFX Help
Plugin provide easy acces into JavaFX SDK documentation. You can invoke help by or press Ctrl + F1
Footnotes:
- Any time you can setup or change the
JAVAFX_HOMEvariable following these steps:- Open
- Expand and select
- Edit
JAVAFX_HOME
- You can switch profiles in SDK by following steps:
- Right click on project name. Select
-
Double click on . The
Edit Library dialog appears. Here you can set up profile to use.
Your direct links are broken (404). You should link directly to this page instead: http://kenai.com/projects/eplugin/downloads
Posted by Brennan on December 11, 2008 at 11:09 AM PST #
I followed the instructions about, even including installing Eclipse for JEE, even though I already had Eclipse installed. I do not see the JavaFX menu item. I verified that the new flies are in the ECLIPSE_ROOT/plugins and ECLIPSE_ROOT/features.
I am running on Mac OSX 10.5.x. Any suggestions?
Posted by Steve on December 15, 2008 at 02:09 PM PST #
I tried installing the eclipse plugin for JavaFX under windows xp, eclipse 3.4, Javafx sdk 1.1.
Unfortunately it makes the Eclipse help system crash !! It works again if I remove the JavaFX plugin.
I also noticed that it highlighted some errors that were not errors in scripts (i.e. they still build and ran).
This is a shame. I guess it's early days for this eclipse plugins or perhaps it's not compatible with some others.
Posted by sOzralis on February 18, 2009 at 11:50 PM PST #