WidgetFX Calendar Tutorial

27 01 2009

Update 1: This sample is now Java 1.5 compatible.

Update 2: The Calendar Tutorial has been updated for the WidgetFX 1.2 beta!  Updates are highlighted in red.

WidgetFX makes it simple to deploy JavaFX widgets to the desktop.  This tutorial that Keith Combs and I developed will show you how to create simple Calendar Widget that shows the current year, month, and day.  For some visual splash, we will also make the widget appear like a stack of calendar pages complete with a spiral binding.

Calendar Widget

Calendar Widget

The first step is to download the latest SDK from the WidgetFX site.  You can download the SDK from the following link: http://code.google.com/p/widgetfx/downloads/list

Read the rest of this entry »

Advertisements




JFXtras 0.2 Release – Shapes, Shapes, and More!

23 01 2009

I am pleased to announce the JFXtras 0.2 Release!  This release features a new custom shape library that came out of a joint effort with the jSilhouette Project.  Thanks to Andres Almiray and Dean Iverson for making this happen in time for the release!

You can download the 0.2 Release directly from the Google Code project site under Feature Downloads:  http://code.google.com/p/jfxtras/

The following screenshot gives you a taste of what the new shape library is capable of:

JFXtras Shapes Demo

JFXtras Shapes Demo

In addition to this, there were lots of enhancements to the existing components, including the following changes:

JFXtras Grid Enhancements:

  • Fixed triggering of updates in the Grid when a child min/max/pref size changes
  • Added in cell defaults for nested Grids
  • Fixes a defect with where packed dialogs could not be repositioned
  • Fixes a defect with dialog modality when packed is set to false
  • Improved the succinctness of expressing Grid layouts with a new syntax (backwards compatible with the 0.1 syntax):
    • new row function that allows more concise expression of row contents
    • modified cell constraint names to be shorter (old names are still supported, but deprecated)
    • added in a helper class (GridConstraints) with a set of disambiguated static imports that can be used to more succinctly express constraints

    JFXtras Test Improvements:

    • Added additional test expectations:
      • is (decorator)
      • isNot
    • Fixed null handling of test expectation methods
    • Changed nested test behavior to setup and teardown per subtest
    • Shorted “assumeThat” to “that” for test fluency

    Enjoy the new release, and please join the mailing list to give us feedback or request new features!





    WidgetFX @ M3DD Conference

    22 01 2009

    Through a generous invitation by Sun, I had the opportunity to attend the Mobile, Media & eMbedded Developer Days (M3DD) Conference down in Santa Clara.

    There was definitely some very cool stuff going on, most notably the upcoming JavaFX Mobile release.  Is it real?  Well, here is a screenshot of JavaFX running on a real device:

    JavaFX Mobile on a Real Device

    JavaFX Mobile Running at M3DD

    The official release is due out in February, which will include full support for deploying JavaFX applications that use the common profile to mobile devices.  The JavaFX Mobile team has been super busy cranking out the last few bits for the upcoming release, but were at the conference in force, armed with a myriad of devices to show the platform capabilities. Read the rest of this entry »





    WidgetFX 1.0 Release

    6 01 2009

    The WidgetFX project reached a huge milestone today, hitting a production 1.0 release!

    Here is a link to the public release page: http://widgetfx.org/

    The new version is compatible with JavaFX 1.0 and sports a completely new look and feel for the desktop dock:

    WidgetFX 1.0 on the Desktop

    WidgetFX 1.0 on the Desktop

    WidgetFX is an open-source desktop widget platform written from the ground up in the JavaFX Script language. It can run widgets written in JavaFX Script and Java and takes advantage of the latest features of the Java Platform.

    Some of the new and noteworthy features include:

    • Skinning Support – WidgetFX now takes advantage of the new CSS skinning support in the JavaFX 1.0 release so you can change the look of your widgets and even the WidgetFX dock itself!
    • New Dock Theme – Graphics Designer, Mark Dingman, did a complete overhaul of the WidgetFX UI, providing a new color scheme, logo, and a simplified design.  Notice that when the dock is not highlighted you can now access your icons underneath it!
    • Embedded Flash/Flex Widgets – WidgetFX makes it easy to take your existing investment in Flash or Flex applications and turn them into desktop widgets.  The same events you get in JavaFX are exposed via a Javascript bridge to Flex applications, so you can do full-featured widgets.
    • Performance Enhancements & Bugfixes – There are too many small fixes and improvements to list here, but after several weeks of solid break-in time the dock is very stable on the JavaFX 1.0 platform.

    Keith Combs helped revamp the website with a new theme and deployment toolkit support for Java auto-detection.  Give the new site a try and show off your JavaFX spirit by running WidgetFX today!

    http://widgetfx.org/





    Hacking JavaFX 1.0 to use Java 1.6 Features

    2 01 2009

    Mark Chance was the first lucky user of JFXtras who ran into the JRE version issue when compiling the code. He had installed the latest version of Netbeans and configured a 1.6 JavaFX library, but was still getting “object not found” exceptions on 1.6-only classes. What was he doing wrong?

    It turns out that the JavaFX 1.0 SDK ships with a slimmed down copy of rt15.jar in the lib/desktop folder, which ends up in the javafxpackager’s classpath for code compilation. This doesn’t have any of the new classes introduced in 1.6 such as SwingWorker, SystemTray, or even String.isEmpty(). However, if you plan to take advantage of any of the cool features of Java 1.6 like transparency or shaped windows, chances are that you require Java SE 6 anyway.

    Here is how you hack the JavaFX 1.0 SDK to build against Java 1.6:

    1. Go to the installation directory of your 1.6 JRE and copy lib/rt.jar
    2. Find your JavaFX SDK installation directory and go to lib/desktop
    3. Delete or rename the existing rt15.jar file
    4. Paste the 1.6 rt.jar from step 1 into this folder, renaming it to rt15.jar

    And that is it, you can now compile Java and JavaFX code with the javafxpackager that depends on 1.6-only features!

    One important note for NetBeans users: Make sure to also update the rt15.jar in the JavaFX installation that comes bundled with NetBeans 6.5. If you forgot to do this, any projects that use the default JavaFX SDK will fail to compile.