Eclipse plugin for JavaFX Script
By octav on Dec 10, 2008
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
- Install JavaFX SDK
- Install Eclipse
- Install Plugin
- Hello World
- Download plugin:
- Unzip into eclipse installation directory
- There should be new files in
- Run Eclipse
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.
MyJavaFXProjectand 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
To set up
JAVAFX_HOMEproperty follow steps bellow:
- Press on message dialog. No thanks, I preffer button.
You should see dialog below with
button on right side to bring up edit window.
button and select installation folder of JavaFX SDK.
Press Folder Selection dialog,
press on Edit Variable Entry dialog.
Press Preferences dialog.
JAVAFX_HOMEvariable has been set up.
Voila! you have first JavaFX Project.
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.
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
Drag Insert Template: Stage
dialog appers. Change title into Hello World!.
into editor window and drop. The
Running application in Eclipse is very easy.
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 is in Eclipse platform provided automatically. For more building options openmenu
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.
Plugin provide easy acces into JavaFX SDK documentation. You can invoke help by
Ctrl + F1
- Any time you can setup or change the
JAVAFX_HOMEvariable following these steps:
- Expand and select
- You can switch profiles in SDK by following steps:
- Right click on project name. Select
Double click on Edit Library dialog appears. Here you can set up profile to use.