aspose file tools*
The moose likes JavaFX and the fly likes What are the benefits of using JavaFx over Swing ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "What are the benefits of using JavaFx over Swing ?" Watch "What are the benefits of using JavaFx over Swing ?" New topic
Author

What are the benefits of using JavaFx over Swing ?

Anu Bhagat
Ranch Hand

Joined: Jun 20, 2008
Posts: 64
I am new to javaFx. I have build my first hello world JavaFx Application. still trying to understand what are the benefits of using JavaFX? Can we add JavaFX GUI to existing Swing GUI? Can we Use JavaFx GUI from Java code?

Are there any good web sites, books, that will help some one to get started and understand it well? may be something like Head First series....

Thanks.

Anu Bhagat


SCJP5.0, SCJA
Gail Anderson
Author
Ranch Hand

Joined: Jul 07, 2009
Posts: 44
You can write JavaFX Swing programs using much less code because JavaFX performs all of the Swing-based housekeeping for you. You don't have to register event listeners and it writing action functions is more concise. Furthermore, with the JavaFX binding mechanism, it is simple to integrate the GUI components with your underlying model. Binding in JavaFX is very powerful.

The JavaFX declarative style not only makes your code more readable, but it makes it more concise too.

While you can use the JavaFX swing components, you can also use JavaFX "native" components that include TextBox, Button, Hyperlink, ToggleButton, RadioButton, ToggleGroup, CheckBox, ListView, Label, ScrollBar, Slider, ProgressBar, ProgressIndicator. The advantage of the "native" controls is that they work in all environments: desktop, mobile, and tv, while swing-based controls work only in the desktop environment.

Our book, Essential JavaFX, is meant to get you up to speed with JavaFX quickly. It has a chapter on UI controls, both the "native" ones and the swing-based controls. Here is an example of an using the swing-based controls that lets you order a pizza. It takes advantage of the ability to easily use graphical objects with JavaFX.

Launch Order Your Pizza
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: What are the benefits of using JavaFx over Swing ?