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?
Asked
Active
Viewed 1.5k times
2
-
How do you think changing frameworks will improve your design? – MadProgrammer Feb 08 '16 at 10:08
-
There already is a discussion on a similar topic here: https://stackoverflow.com/questions/16694948/swing-vs-javafx-for-desktop-applications/21838439 – Yonathan W'Gebriel Sep 08 '16 at 14:04
1 Answers
4
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)

Prim
- 2,880
- 2
- 15
- 29