Gillius's Programming

February 2013 Archives

JFXUtils 0.1 Released -- February 22, 2013 10:43 PM

I wrapped up some of the JavaFX code I've been working with into a library org.gillius:jfxutils, which is hosted at github (project page). The artifact is also published in my Maven repository. It offers the following now:

  1. Ability to add zooming capabilities to a JavaFX XYChart in both plot area and axes.
  2. The scaling-on-resize effect described in my previous post.
  3. An experimental way to replace a Node in the scene graph with a different one (it's not as easy as you think)
  4. A way to get X and Y offsets of a Node from an arbitrary ancestor in a way that handles translation/padding/layout, etc., but does not yet handle scale and rotations (this might be possible if transforms can be combined as rumored for JavaFX 8)

I plan on adding panning compatibility in a future release.

With JavaFX billed as the preferred new front-end system for Java, and Java 7 becoming prevalent and bundling JavaFX as of 7u6, I've started to take a very hard look at this technology, especially compared to Swing. And from everything I've seen so far, I'm very impressed.

The first application I've had the chance to use JavaFX with is a presentation application on a custom piece of kiosk hardware that has 4 separate screens on it. For my skillset, the choices were either HTML5 or Java. I wasn't keen on trying to figure out how to get 4 separate monitors to work with Chrome browsers or something similar, and I know Java better, so I went the route of JavaFX.

For this application, I wanted to create screens that worked basically like PowerPoint slides. The resolution on the kiosk screens is high and the user is far away, so the "normal size" of the GUI interface would not be sufficient. I wanted something where as I expand the window the content gets larger (like in PowerPoint) rather than stay the same size and reflow, like in a standard GUI application. Fortunately, the transform capabilities in JavaFX make this very easy.

« November 2012 | Main Index | Archives | March 2013 »