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

  1. Installation
    1. Install JavaFX SDK
    2. Install Eclipse
    3. Install Plugin
  2. Hello World
    1. Creating JavaFX Project and configuring JavaFX SDK
    2. Adding files
    3. Running
    4. Building
    5. Configuration options
    6. JavaFX Help

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

  1. Download plugin:
  2. Unzip into eclipse installation directory
  3. There should be new files in ECLIPSE_ROOT/plugins and ECLIPSE_ROOT/features
  4. Run Eclipse

Hello World

Creating JavaFX Project and configuring JavaFX SDK

  1. Start eclipse. You will see the basic layout of workbench.
  2. In Package Explorer view click right mouse and select New > Java Project
  3. Create new JavaTM project.
  4. Name it MyJavaFXProject and press Finish button. The new project appears in Package Explorer.
  5. Open project popup menu and select JavaFX > Add JavaFX Nature.
  6. 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_HOME property.

    To set up JAVAFX_HOME property follow steps bellow:
    1. Press OK on message dialog. No thanks, I preffer Cancel button.
    2. You should see dialog below with JAVAFX_HOME set to (empty) value.
    3. Press Edit... button on right side to bring up edit window.
    4. Select Folder... button and select installation folder of JavaFX SDK.
    5. Press OK on Folder Selection dialog, press OK on Edit Variable Entry dialog.
    6. Press OK on Preferences dialog. The JAVAFX_HOME variable has been set up.
    If you select Cancel button on error dialog you will skip this setup and system will never ask you for this again. To setup this later just follow this instructions.
  7. Voila! you have first JavaFX Project.

Adding files

  1. Expand MyJavaFXProject. Left click on src folder. Then select New > Package and type into Name package name com.sun.eclipse.example.
  2. Left click on src/com.sun.eclipse.example folder. Then select New > Empty Script.
  3. The New File wizzard will appear. Type Main into Name field.
  4. Press Finish button and empty new JavaFX script is created.
  5. Let's focuse on Snippets view. There is a lot of code snippets to help you develop your application. Expand Applications and select Stage.
  6. Drag Stage into editor window and drop. The Insert Template: Stage dialog appers. Change title into Hello World!.
  7. Press Insert button to insert template result into source code. Done

Running

Running application in Eclipse is very easy.

  1. Press Run button on toolbar to lunch application.
  2. If you are running first time the Edit Configuration dialog appears.
    All options are setup to default values. The most interesting part is Profile - Target 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
  3. 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 Project menu

Configuration options

  1. Select project in Package Explorer, right click and select Properties.
  2. The Properties dialog appears. Select JavaFX Defaults.
    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 Help > Java FX > JavaFX Script Documentation or press Ctrl + F1

Footnotes:

  • Any time you can setup or change the JAVAFX_HOME variable following these steps:
    1. Open Window > Preferences
    2. Expand Java > Build Path and select Classpath Variables
    3. Edit JAVAFX_HOME
  • You can switch profiles in SDK by following steps:
    1. Right click on project name. SelectProperties > Java Build Path > Libraries
    2. Double click on JavaFX System Library. The Edit Library dialog appears. Here you can set up profile to use.
Comments:

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 03: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 06:09 AM 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 03:50 PM PST #

Post a Comment:
Comments are closed for this entry.
About

octav

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today