JavaFX Tutorial – Basics

JavaFX seem to be gaining ground on the RIA space. With the right tools and development support, it wil definitely have its toll on the next best technology “thing!”. I’m not writing any JavaFX review here since there is a lot of Technology critiques out there that probably reviewed it extensively, but instead, I will write a simple tutorial on how can you develop JavaFX application in your MacOSX lion. 🙂

First some pre-requisites:

  • JavaFX Runtime Environment
  • Java Runtime Environment
  • JavaFX SDK
  • JavaFX Scene Builder
  • JavaFX IDE – I had chosen NetBeans 7 as it already has support for JavaFX.

This can all be downloaded on the Oracle Website. You may google it. 🙂

Requirement: Create a simple application that accepts (you guess it) person details (simple registration), a custom web browser and some analytics.

Technology: JavaFX and JPA 🙂

Step 1: Create the Database and Tables

Simple Database and Table, download the SQL file: here

Step 2: Create the User Interface and specify the controller

Using the JavaFX Scene Builder, create the user interface.

Step 3: Development

Code the App!

NetBeans has its support for JPA – so I used it to interact with the database.

Download the source:  here

Its basically a very simple application, but I think this sample will give you a brief introduction or a head start on how to actually develop an application using the platform.

Not a bad alternative if you want to create Desktop Applications, which of course, .net offers much better solution. Though the main take away here is that JavaFX redefines Java Desktop Application Development – flexible enough to support the best of both worlds (Desktop and Web) and if thats not enough, it also supports mobile phones.

Java Magazine – November / December 2011 Look inside >
November/December 2011

I’ve recently received the newsletter from Java. I’m stunned I guess.

The whole e-newsletter was made using JavaFX Technology, I never knew its full blown capabilities in action before seeing this e-newsletter. 🙂 Check it out and see for yourself. You might want to check JavaFX RIA technology as well. Perfect for creating RIA driven applications (though still arguable since GWT and Silverlight is extremely rich in API and backed by community support).

Some “stuff” in the newsletter:

Java 8 – Java 7 haven’t quiet made a decent impact yet, but that doesn’t stop the Java community from improving it. The Newsletter introduce us to some plans and JSRs that might be included on the future SDK version.

Java 8 – along with the introduction of Lambda Expression Support: The first time I heard a programming language that supports lambda is when I tried reading through the C# docs at MSDN website. As far as I can remember, lambda expressions for c# started on the 3.5 version (or 2). I think this indicates that there are still lags on the Java side yet I won’t count them out (and will never). 🙂

I can tell all the stuff that I’ve read on the e-newsletter, or you can register yourself in it: