Home Ask Login Register

Developers Planet

Your answer is one click away!

user1914272 February 2016

What is the difference between unsing JAVA FX and SWING

I am using Java Swing to develop my application and i should finish it as soon as possible, but the design is very bad. I found some advice which tells me that I should use JAVA FX. What is the difference between Java FX and Java Swing ? Will there be any change on the line of code?


Prim February 2016

Main difference could be the release date... JavaFX is more recent and can be considered as the successor of Swing.

There is many very useful features added in JavaFX. See here some key features : https://docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-overview.htm#A1131418

I can list the main features for me:

  • Styles can be set by CSS (something similar to)
  • Bindings: easy way to bind a ui-value, like width of text of input, to a field in class. Changing the value of the field updates the ui without boilerplate
  • Animations/Transitions: easy way to make an animation, like a ui components which blinks or moves
  • 3D: easy way to manipulate model to make animated 3D view

For making a new application from scratch, i think you should consider using JavaFX, Swing is outdated (imho)

Post Status

Asked in February 2016
Viewed 2,730 times
Voted 14
Answered 1 times


Leave an answer

Quote of the day: live life