Upgraded JavaFX Support in NetBeans IDE 6.5
For sure, one of the simplest things to do is to go to javafx.com and download the bundle "NetBeans 6.5.1 + JavaFX 1.2". But what if you don't want to re-install an existing NetBeans 6.5.1, maybe with your personal configurations and settings?
First, let me clarify a point that probably hasn't been addressed enough. NetBeans has got improved IDE support for JavaFX, beyond the SDK update - much improved, as the previous one was poor in many aspects (e.g. fix imports was often broken, you got a lot of false positive errors in the editor, etc...). For what I can see, most of these problems have gone away.
Now, there are two scenarios:
- if you have downloaded the NetBeans + JavaFX 1.2 bundle, you've got the new JavaFX support in the IDE
- if you still are running a previous NetBeans 6.5(.1) installation, you have to get the upgrade via the update center. As far I can see, the update center was installed only this morning, my local time.
To check what you have on your system, go to the "Tools / Plugins" menu and select the "Installed" tab; then type "javafx" in the "Search:" box.

You should see three plugins (if you're not seeing them, go to the "Available Plugins" tab and install them):
- JavaFX Kit: it's the IDE support for JavaFX. The latest version is 1.8
- JavaFX Weather Sample: it's a small sample application. The latest version is 1.7 - BTW, I find it not much useful, since a pack of demos with source available is on javafx.com
- JavaFX SDK (for Mac OS X in my case): it's the SDK. I think you can avoid installing this plugin if you have explicitly downloaded and installed the standalone version of the JavaFX SDK. In any case, the most recent version is 1.7
If you don't see the update, try to press the "Reload catalog" button.
Checking the version numbers and eventually performing an update is all you need to have a working system in the quickest way.
Manually configuration of JavaFX SDKs
Now, my advice for advanced people is to manualy configure the JavaFX SDK - in this way, for instance, you could have both JavaFX 1.1 and 1.2 to co-exist on the same NetBeans installation (maybe because you have decided to postpone the upgrade for an existing application, but would like to start playing with the newest one immediately).
I haven't tried it yet, but since the JavaFX SDK name doesn't include an explicit version number, I suppose that when you upgrade you loose the JavaFX SDK 1.1 configuration.
It's easy to manually configure the JavaFX SDK. Open NetBeans and select the menu "Tools / Java Platforms".
You'll see a configuration panel showing all the Java platforms installed in the IDE (JSE, JME - if enabled, and JavaFX). Of course, in the screenshot you see the JavaFX node because I had previously installed JavaFX 1.1 in the IDE.

Now push the "Add platform..." button at the bottom. A new option dialog appears:

Select JavaFX Platform and press "Next".
In the "Platform Setup" dialog, first enter a name for the new platform (e.g. "JavaFX 1.2") and then point to the directory where the SDK is installed (for Mac OS X, it's a bit quirky as usual: Library/Frameworks/JavaFX.framework/Versions/1.2/).

Now press "Finish". The new SDK should have appeared in the list of supported platforms.

You're almost done. Now open your JavaFX project and go to the Properties panel; select the "Libraries" node and select "JavaFX 1.2" (or whatever you inserted first) as the JavaFX Platform.

That's it. This worked for me with Mac OS X and Windows XP. For Linux, the option to configure a JavaFX platform appears only if you have upgraded the system (as there was no previous official support)
Enjoy!
- Login or register to post comments
- 2331 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
Dar Var replied on Fri, 2009/06/05 - 9:46am
NetBeans 6.7 RC1 does not have the JavaFX plugin in the Available Plugins or Installed tabs. Strange.
coffeejolts replied on Fri, 2009/06/05 - 12:28pm
PatrykRy replied on Fri, 2009/06/05 - 12:40pm
Fabrizio Giudici replied on Fri, 2009/06/05 - 3:19pm
@Dar Var: I believe JavaFX support for 6.7 will come later in form of a plugin. There have been a few incompatible changes in the IDE, so the plugin for 6.5 won't work in 6.7.
@PatrykRy: code formatting has been temporarily disabled because of a bug. I must say I won't probably use it: with JavaFX I'm finding that I format things in different ways in function of the context. For instance, with a large number of attributes I do:
while where a single attribute is present:
def xyz = Bar { attr1: "xyz" }I've seen such a high degree of formatting variations in my code that I don't think an automated formatter is able to handle. Maybe it's just because I've still to find a style for my JavaFX coding?