• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

What are the benefits of using JavaFx over Swing ?  RSS feed

Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....


Anu Bhagat
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!