Skip to content

Using JavaFX in GumTree_139166243

nxi edited this page Apr 9, 2015 · 1 revision
Created by Tony Lam, last modified on Feb 17, 2010

Introduction

JavaFX is a rich and interactive scripting environment for developing Java graphical user interface.

Development Environment

  • Install JavaFX Eclipse plug-in (JavaFX runtime is not required)
  • Checkout com.sun.javafx from SVN (use as your JavaFX runtime for compilation and execution)
    • Note: this is a strip down version of JavaFX, which contains only the desktop profile, with JFXtras extension.

How to develop JavaFX component for GumTree

The trick for using JavaFX within GumTree is by pre-compiling the JavaFX scripting into Java classes. Although it is possible to use JSR-223 to run JavaFX script directly (http://sinnema313.wordpress.com/2008/08/01/running-a-javafx-script-from-an-osgi-bundle/), the JavaFX 1.2 has a problem stopping it loading from script (http://forums.sun.com/thread.jspa?threadID=5393585). Also, it suffers from performance issue as it takes time to compile the script. Step 1: Create a new JavaFX project in Eclipse IDE
Step 2: Develop the JavaFX script as usual
Step 3: Run the script to produce the jar file in "dist" folder
Step 4: Copy the jar into your GumTree plugin, and add to the build path. Also update your plug-in runtime classpath
Step 5: Use JXScene from JFXtras to embed your JavaFX object into AWT (http://jfxtras.org/portal/core/-/wiki/JFXtras/JXScene)
Document generated by Confluence on Apr 01, 2015 00:11
Clone this wiki locally