• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

What are the benefits of using JavaFx over Swing ?

Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic