views:

1902

answers:

5

Most of the desktop application development I do is in Swing, and I'm curious to hear people's thoughts on using JavaFX and/or Adobe Flex for building desktop applications. Have you had success building desktop apps with these? Or would you stick with Swing for now and use tools to help make Swing development more productive?

+7  A: 

If you're making desktop apps, I'd stick to Swing. JavaFX/Flex/Silverlight would be more appropriate for RIA - rich internet apps. Although I'd argue that none of them would be a choice for the long term - looks to me like HTML5/CSS3/Ajax are winning the day, but thats a pretty subjective area. But for desktop apps - I'm a big fan of Swing (also Java Web Start is a very underrated technology)

CarlG
+5  A: 

I would say that JavaFX can be seen as a kind of extension of Swing with a new way of developing a Java GUI by using a declarative programming language: the JavaFX Script. JavaFX Script code looks exactly like a JSON script, unlike Adobe Flex or Microsoft Silverlight which uses an XML syntax.

JavaFX Script can interface with Java and therefore can call Swing components easily. It's really a new generation of GUI API, like Swing was for AWT: nice graphical components, new easy ways to manage layouts, really nice features to build dynamic interfaces: bindings, timers (to build animations), etc. Have a look here: http://www.javafx.com/samples/ and to the tutorials and see how fast you can build a kind of Google Picasa application... The API even contains some tools to use easily web services: you can find plenty of samples of GUI built in JavaFX connected to some public web services (like a Weather Forecast tool).

And the best... is the deployment part. You can embed your application within an html page, like an applet, and the user can drag and drop the application to her/his desktop to use it whenever she/he wants (without returning to its browser)!

Really, I think JavaFX, at its early stage though (v1.2), is a really good tool and represents the first step for Java toward the next generation of applications: the Rich Internet Applications (RIA).

SirFabel
+1  A: 

You should try them all and see which one fits best with your requirements. If you want to see what you can do with Flex and how to do it then check out Tour de Flex.

Some of the advantages of Flex are that it is mature (over 5 years old now) and a significant area of investment for Adobe. You can also find numerous examples of AIR apps built with Flex in the Adobe AIR Marketplace.

James Ward
+1  A: 

Swing can look good with Substance L&F.

However, if you are developing alone (as opposed to with a team), trying JavaFX might be a good idea.

glebm
A: 

Java Swing is an established and mature technology for desktop development. You'll be able to find lots of information online and plenty of sample programs. With that said, however, you might want to consider Adobe AIR. AIR is basically a runtime that lets you run your Flex apps on the desktop, and gives them access to local resources such as the file system. I've written Java Swing apps for 10 years and I am amazed at how much more productive I am using Flex/Adobe AIR. One nice aspect of Flex is that you can create your GUIs declaritively, much like how you use HTML to declare the layout of a webpage. It's a much more concise way to specify a GUI, and much faster and easier to maintain than the reams of Java Swing code you need to do the same thing. I wouldn't recommend JavaFX since it is so late to the party and hasn't really gotten with mainstream developers.

Pedro Estrada