If you are looking to get a feel for JavaFX features, this blog entry will take you through the path of using JavaFX with Ant, the Java Collections framework and Glassfish application server.
* JavaFX Client Placing Nicely With GlassFish In order to get an JavaFX client to find an EJB on the GlassFish application server there two ways to go. The first way is to get GlassFish 2 update release 1 and follow the instructions to create an EAR. This way supposedly works if you are using Java EE 5 annotations. Tim Quinn is the Sun engineer to talk to here. [Yours truly has not made it that far yet.] The second way is to run JavaFX as a standalone Java client and include the GlassFish runtime libraries. Okay there is no injection of resources for @EJB annotations, but one can still retrieve a reference using the traditional JNDI lookup. Here is the missing code that defines the GlassFish path identifier for the Ant build script earlier. It is pretty straight forward, because I examined the APPCLIENT.bat file for information on the JARs to include here. You might need to include a few libraries to do extra stuff like web services or JCA. Here is the EJBConnectionHelper.java file: /* * Created on 13 Dec 2007 by Peter A. Pilgrim */ package client; import javax.naming.InitialContext; import com.xenonique.product.fxrates.core.ForwardCurve; import com.xenonique.product.fxrates.core.RatePrice; import com.xenonique.product.fxrates.ejb.FXCurveManagerService; public class EJBConnectionHelper { private static FXCurveManagerService curveService; public static FXCurveManagerService getFXCurveManagerService() { if ( curveService == null) { synchronized (EJBConnectionHelper.class) { if ( curveService == null) { curveService = getServiceFromJNDI(); } } } System.out.println("curveService="+curveService); return curveService; } public static FXCurveManagerService getServiceFromJNDI() { final String JNDI_NAME="ejb/FXCurveManagerService"; try { InitialContext ic = new InitialContext(); FXCurveManagerService service = (FXCurveManagerService) ic.lookup(JNDI_NAME); return service; } catch (Exception e) { throw new RuntimeException( "Failure to retrieve curve manager service",e); } } } This code is performing an look of the stateless session EJB. It caches the EJB reference and is also thread-safe. The static method is called by the JavaFX client. So using the Ant macrodef above now works.
Read Peter Pilgrim's entire post: http://www.jroller.com/peter_pilgrim/entry/javafx_integrating_with_java_collections