Well, dear reader this is one of those many times where I don’t know what your background is, how much time you have spent working with the Java language or how much detail you already know about the origins of Java. So, I will go back to the start and give a quick gloss-over-rundown of the past, but forgive me if you’ve heard this part before.
In the beginning, there was “awt” or Java’s abstract window toolkit which was used for both Applets (embedded Java programs on webpages) and Applications. With this you could create buttons, checkboxes, text fields, etc and make a program with a basic user interface.
Then came Swing, Java’s updated gui (graphical user interface) library with more tools and an updated look and feel. Swing is still very popular and widely used, but now that Java has Oracle at the helm we are once again seeing Java move into a new and exciting direction.
I was surprised to learn that JavaFx has been around for a long time. Even before Oracle acquired Java from Sun Microsystems in 2009, Sun acquired the technology when they bought out ‘See Beyond’ in 2005. It started out as more of a side project when it was first released as ‘JavaFx’ in 2007, and didn’t gain much traction even after Oracle acquired Java. But then in 2010 Oracle announced the future direction for Java which included a completely redone JaxaFx as the centrepiece technology for building applications. At the time of writing this post, the latest version of Java is Java 8 which was released in March 2014 and it is the first MAJOR Java release that includes JavaFx as an integral part of its core distribution.
JavaFx is here to stay
If you go directly to the JavaFx faq source at Oracle they state clearly that yes, “JavaFX (is) replacing Swing as the new client UI library for Java” which is why it makes sense as Java developers that we start taking JavaFx seriously and start embracing it as the best way to build applications in Java.
Summary of JavaFx Features
So what’s the big deal with JavaFx anyway? Well here in a nutshell are the main features of JavaFx, which also try to answer the question “why use it in the first place?”
- New and improved interface tools that way WAY beyond your standard buttons, checkboxes, etc. (Think bar and pie charts and cool things you can find using JQuery like date-pickers, accordion panes, tabbed panes etc.) . Check out a nice summary of JavaFx controls here. This includes new media player and web rendering controls.
- A new ‘language’ called FXML, which like HTML is used only to define the interface of an application, keeping it completely separate from the code logic.
- An outstanding application called ‘Scene Builder’ which can be integrated into NetBeans and Eclipse to allow you to create and generate FXML documents using a drag-and-drop design interface (think Dreamweaver for HTML)
- A new powerful way to control the design of your application with CSS-like syntax and precision. If you know any CSS you will easily be able to make the transition to styling JavaFx applications.
- An integrated library for graphics (both 2D and 3D) as well as animation tools that rival Flash, JQuery and CSS animations
- Mobile platform development tools (which admittedly, I know very little about at the time of writing this post but like everything else on this site, as I learn I share). There is an open-source project called JavaFx ports that helps bridge the path to mobile application development with JavaFx
- Speaking of open-source, that is EXACTLY what JavaFx is. This is cool for 2 reasons:
- It’s survival chances are greatly improved with a worldwide army of JavaFx fans contributing to the development and well-being of the technology
- Others are quickly developing additional tools, plugins and UI controls that go beyond the offerings at Oracle. Check this out from ControlsFX – very cool!.
JavaFx is Not an HTML Killer, But it IS a Swing Killer
Like any new technologies there are going to be those people who quickly adopt it, and those that say it is a fad and wait on the sidelines for it to pass. I have found a couple of interesting articles as food for thought, both of which go beyond the scope of intimate knowledge I have for the issue:
I have to admit it has taken me a while to embrace JavaFx because I used to be a part of the latter group. Maybe getting a domain and devoting an entire site to it is going a bit overboard, but I think you can see clearly which group I belong to now. What about you? Have you started using JavaFx or are considering trying it out in the future? Or are you of the opinion that JavaFx too shall pass? I’d love to hear your thoughts. Cheers!