Thursday Apr 16, 2009

Students get in full access at Java One

The Java One 2009 Conference will give full access (general and technical sessions, hands-on-labs, etc.) to all students that can make the trip. This new program provides students a huge opportunity to learn, network and interact with industry experts.

Friday Apr 03, 2009

Ricoh and Java Developer Challenge

I had a great time at the Ricoh & Java Developer challenge in London. I represented Sun, one of the sponsors of the this University event, and judged the submissions by the five finalists of the contest.

Being the judge was quite an interesting experience. I was truly inspired by the innovation and dedication of the students from Norway, Spain, Germany, France and Hungary that presented projects at the competition. Submissions ranged from Optical Mark Readers, to Context aware Multi Function Printers (MFP) software. Judging had to take into account both technical and business point of views. Hungary (Zoltan Szabo & Balazs Lajer from University of Pannonia) won, by a hair ahead of Germany. Congratulations to all the students and professors involved.

Wednesday Apr 01, 2009

United needs to "upgrade" the dinner rolls on the 777 flights

In the last few weeks I flew United to London a couple of times and on both flights the dinner rolls that were served with the food seemed to date the build year of the Boeing 777-200 (ca. 1995-1998). If for some reasons UAL can't serve fresh bread, I suggest they stop (hey, who needs the extra carbs anyway!). I would not mind paying for the meal as long as value is provided.

The other option for United (if they still have a large stock of last century bread) is to donate the rolls to the Pentagon. I am sure it can be used for target practice as ammunition for cluster bombs.

Monday Mar 30, 2009

Clear mirror

I was looking to download Ubuntu so I can install it under Virtual Box on my fairly new MacBook Pro. I went through a few mirrors and found one that gave me flaming speed -

Download URL:

Tuesday Mar 24, 2009

JDK 7 features

Mark Reinhold just published a blog which details the list of features that are currently planned for JDK 7, by the OpenJDK community. The idea is to give a  preview at Java One in June and release in the spring of CY10.

We are hoping for comments and feedback, via the openJDK mailing list. Dalibor is also working out the schedule for the next OpenJDK call, which will be open to all the folks in the community.

Friday Mar 20, 2009

JavaFX developer challenge

The JavaFX team is ready to deploy the JavaFX developer challenge. Students and developers should already familiar with the concept. Companies such as Google, Adobe and Microsoft have implemented similar contests to get developers to adopt new technologies.

Here are some tips on how to improve your odds of winning:

  • Use NetBeans 6.5 - it will make you more productive
  • Deploy your application on the web, rather than just submitting the sources - JavaFX is all about build rich user interfaces, and the web is the best way to showcase your work
  • Embed you application in a widget that can become viral within social networks. For instance you could use zembly to build and deploy a Facebook application
  • Don't mix and match in your user interface. JavaFX Script provides a different programming model than Java and while you could call Java (e.g. Swing) from the UI, it will likely not look good. The team is building a new set JavaFX UI controls, however this library is not available yet.


Thursday Mar 12, 2009

JavaFX and Ajax

Ken Russell, the architect and author of the new Java Browser plugin has recently completed the work on the JavaFX to JavaScript bridge. In a nusshell, JavaFX web applications could call JavaScript functions & objects in the webpage that embeds the JavaFX app and vice versa. Nota bene: this bridge calls for the plugin to use Java SE 6 update 10 or later.

JavaScript to JavaFX Script

JavaFX Script can be accessed using the synthetic script field which is exposed from JavaFX Script applets to the JavaScript engine.

function someJavaScriptCall() {

var myApp = document.getElementById("myApplet";);



The snippet above, assumes that the Java web application (Applet) embedded in the web page is instantiated with myApplet as id.

JavaScript to JavaFX Script

JavaFX Script can interact with JavaScript on the web page, in a similar way to how Java code can interact with JavaScript. This lets you call JavaScript functions defined on the web page, modify the Document Object Model (DOM) of the web page on the fly, and generally write JavaFX Script apps that integrate well within the web page.


Wednesday Feb 11, 2009

JavaFX Mobile ships

The Eran Davidov show is now coming to a mobile device near you. In other words, the JavaFX team at Sun has delivered JavaFX Mobile. The JavaFX platform enables the development and deployment of rich and expressive content and services to end-users across desktop, mobile, browser and TV (due later on this year). This release follows the December '08 shipment of JavaFX 1.0 for desktop.

[Read More]

JavaFX layout considerations

As the team is getting ready to release JavaFX 1.0 Mobile, I was experimenting with layout considerations of deploying of JavaFX applications to mobile devices.

Below are a couple of considerations for developers who will build applications for devices that have typical screen size of 320x240 pixels. The example below (inspired by Josh), draws a centered circle and uses for its radius a % of the width of the device screen size.

The other interesting point that the example illustrates is how to convert a String type into an Number. Java developers will recall using something parseInt to achieve this task (i.e. int foo = Integer.parseInt("7";);). Similarly, in JavaFX you could use this technique as follows:

var myNumber:Number = Integer.parseInt("7");

Serious developers may want to read this blog by Amy Fowler that provides a lot more details on layout management in JavaFX Script.

In general, one has to cautious about calling Java libraries and should stick to the "common" JavaFX APIs. Keep in mind that javafx.ext.swing, javafx.scene.effects packages are out of bounds for mobile developers. Also the mobile emulator (bundled with NetBeans and the SDK) is not yet available for the Mac.

Thursday Feb 05, 2009

Java SE 6 update 12 supports Windows 2008 Server

 Java SE 6 update 12 shipped earlier this week and it is now available for download here. Key improvements include:

  • Windows 2008 Server Support : Java 6 Update 12 now support Windows 2008.
  • Java Plug-in now supports 64-bit browsers (4802695)

Sunday Feb 01, 2009

The team of destiny

The New York Giants have proved me wrong last year. This year I'll try again to predict the outcome of the Super Bowl: Arizona 31 - Pittsburg 30.

Saturday Jan 31, 2009

Installing JavaFX plugin in NetBeans "All" distribution


Most of the developers that want to learn about Sun's new RIA platform - JavaFX, install the bundle that includes SDK, the NetBeans development environment (which includes a JavaFX Script plugin). On the other hand if you are already a developer that uses NetBeans and have adopted the recently release version 6.5 you have a simple way to add install the JavaFX plugin.

Just use the top level menu of the IDE: Tools | Plugin, tab to "Available Plugins" and look for the JavaFX category, select all entries, install and restart NetBeans.

Nota Bene: One of the advantages of using NetBeans to get started with JavaFX is the availability of samples. Open and File | New Project | Samples | JavaFX and you'll note about 40 samples which range from a series of simple building blocks that show you how to work with shapes, transformation, etc. to more advanced examples that illustrate how to invoke web services, or build a media player.

Wednesday Jan 28, 2009

Using println to debug JavaFX

Most of the developers that started programming in the 20th century, before IDEs were broadly used, are familiar with debugging using println statements. While I highly recommend that one uses NetBeans or Eclipse to develop JavaFX RIA applications, I believe certain people will still want to employ old techniques to debug their code.

Here is an example on how to use println in a JavaFX application to print environment variables.

There are a couple of tricks that you may have to be aware of. 

  • You can't use println while you initialize your code (between lines 18 & 34)
  • println will send the output to the console
  • If you want to print onto your UI artifact, you could employ the javafx.scene.text.Text  object
  • Printing environment variables may yield different results depending on your configuration. For instance, using the default - desktop app configuration will give you a different result than when you deploy the app to a mobile emulator

JavaFX application deployed as a clearspring widget

Here is an example of a JavaFX web application, deployed as a clearspring widget.[Read More]

Monday Jan 19, 2009

Learn to program using JavaFX Script

The 1st session of the "15-week JavaFX Programming (with Passion!)" free online course will start on January 30th, 2009. The details of the curriculum can be found at the website.

For registration, all you have to do is to send a blank email to the following email address:

Sunday Jan 18, 2009

Database access from JavaFX Script

Given that there is a wealth of JDBC code out there, I suspect that many developers may try to leverage their investment as they build new rich internet applications with JavaFX. I'll be using NetBeans 6.5 to demonstrate a simple example.

We'll use a simple JavaFX script project, which generates hello world code. Use the libraries node in the project view to add the "Java DB Driver".

As you can see, I am calling TalkToJavaDB.getRecord() which returns a java.lang.String, which in turn I assign to the Text object in my JavaFX script. I am using the Java String object to store an index of the java.sql.ResultSet I get from connecting to a JavaDB (derby) that ships with either Java 6 or GlassFish (v2 in my case).

This example is very trivial and may improve it in time to iterate over the ResultSet and present the data in a more visually apealing way (after all JavaFX enables developers to build great user interfaces, in many cases in half the time and with a lot less code)

Friday Jan 16, 2009

Webstarting your JavaFX application

Here is another tip on how to deploy your JavaFX application using the Java Web Start technology. Of course if you are using a tool such as NetBeans, the whole process is very simple. You would just change you project properties to use "Web Start Execution" and you are done (the IDE will generate the appropriate JNLP file and a browser specific JNLP which includes the applet-desc tag).

If you have to handcode the JNLP file for your application, edit the xml code below, as needed and save with a file with a .jnlp extension. Once you've done this you are ready to deploy the resource and your customer will be able to invoke the JavaFX application by the URL (http://<someplace on the web>/<application_name>.jnlp)

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:/<URL_to_jnlp_file>/" href="<application_name>.jnlp">
        <title>App Name</title>
        <homepage href=""/>
        <description>blah blah</description>
        <j2se version="1.5+"/>
        <extension name="JavaFX Runtime" href=""/>
        <jar href="<Application_name>.jar" main="true"/>
    <application-desc main-class="<package_name_for_your_app>.Main"/>

Thursday Jan 15, 2009

Deploying a JavaFX web application

Deploying a JavaFX web application (applet) is trivial. Just use the following code in your HTML page:

<script src=""></script> <script>     javafx(         {               archive: "Foo.jar",               draggable: true,               width: 200,               height: 200,               code: "foo.Main",               name: "Foo"         }     ); </script>

The snippet assumes that you build and application called "Foo" (package name "foo";). One may only want to use the "draggable" attribute if the application is intended to run on Java 6 update 10 (or later) which gives the opportunity for users to install a web application on the desktop.

Thursday Jan 08, 2009

Java TV Spec released

Talking about pace. The Java TV folks created in a very short period of time the Java specification for digital terrestrial TV. In a nutshell, the API has been designed to provide access to functionality unique to digital television receivers. Here are some of the key features:

  • Audio/video streaming
  • Conditional access
  • Access to in-band and out-of-band data channels
  • Access to service information
  • Tuner control for channel changing
  • On-screen graphics control
In the future this should tie nicely with key value proposition of the JavaFX platform which will enable to seamless deployment of RIA across multiple devices, including TVs.

Saturday Jan 03, 2009

Black Swan

I spent the holidays with Malcolm Gladwell, actually I re-read The Tipping Point. So much to learn from the research and wisdom that he presented so masterfully. Another book that intrigued me is Black Swan. My friend Andrei has highly recommended the book and I just purchased it via iTunes. If I manage to stay involved with domestic tasks tomorrow, I may have a chance to listen to the audio book this weekend.

Tuesday Dec 30, 2008

Java with passion

A priceless resource for developers trying to learn Java and related technologies is the free service that Sang Shin provides online. This is a site maintained by a Sun employee who provides a huge set of online tutorials. I recently reviewed some of the courses to see if we could help provide some expert assistance. The materials are truly well put together and easy to follow. I highly recommend this site to all students and professional looking to learn Java, Ajax, Web Services, Java EE.

I am now looking forward for the update of the JavaFX programming course.

Thursday Dec 25, 2008

Christmas in NYC

I am spending the holidays in NYC with Silvia and the kids. Friends and relatives have also converged into town so the schedule is packed. Today we are going to the MET and Central Park. We are all in need of some exercise after the heavy lifting of food and beverages :-)

The highlight so far ... I've been able to stay away from email and technology!

Wednesday Dec 10, 2008

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


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 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 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


  • 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.

Saturday Nov 29, 2008

JavaFX Script Language Reference

Robert Field just finished the draft of the JavaFX Script Language reference.[Read More]

Friday Nov 28, 2008

The renaissance of Java

The next key iteration of the Java platform & language is currently planned. The stakes, for this highly anticipated release, are high, however Java 7 looks promising. There are several JSRs (203, 294, 291, etc.) in progress and the issue of modularity is also on the docket. A modular Java platform will help address issues of performance (download & startup time, memory footprint), platform scalability (e.g. Java SE scaling to small devices) and packaging (fixing the jar hell issues). These are real customer problems that Java 7 will attempt to address.

The blog to watch for more details is Mark Reinhold's.




« June 2016