This article is a tutorial on the JavaFX GUI library.
What is JavaFX?
JavaFX is a GUI toolkit for creating and delivering desktop applications, as well as rich Internet applications. It comes with a rich set of GUI controls, and open source tool-kits that add even more tools to the total ecosystem.
JavaFX was introduced in 2008 as a successor to the GUI Library Swing. Swing is still the more developed and mature (older) GUI library, but JavaFX is newer and is even compatible with Swing in many ways. Furthermore, JavaFX works better with Mobile Platforms than Swing and across all operating systems such as MacOS, Linux, Android, iOS and Windows.
Why use JavaFX?
Out of all the GUI libraries and programming libraries, why should one pick JavaFX over the others? As mentioned earlier, JavaFX is cross platform and works well on mobile devices. Other languages like Python have separate libraries Mobile and Desktop based applications. JavaFX is all those libraries and functionality rolled into one.
Finally, JavaFX is newer than either Swing or AWT and is the latest GUI flagship of Java. Most GUI applications being developed nowadays are using JavaFX. This ensures that JavaFX will have a long life, whereas AWT has already become a Legacy and Swing is mostly being used in previously existing applications.
JavaFX is a massive library with dozens of different widgets, layouts and other GUI components. Our JavaFX Tutorial covers all of these components and features. A list of them divided by category can be found below.
If you haven’t yet setup JavaFX, read our Installation tutorial here.
Widgets are the small GUI components in JavaFX that add new and rich functionality to the program.
- Input Dialogs
- Alert Dialogs
Layout managers determine the position and setting of the widgets in the GUI window. Each Layout component in the list below has it’s own unique way of positioning components in the layout.
Other reading material:
An expanding list of extra JavaFX related articles meant to further improve one’s skills and understanding of the Java GUI library.
This marks the end of the JavaFX Tutorial. Any suggestions or contributions for CodersLegacy are more than welcome. Questions regarding the article content can be asked in the comments section below.