Recently I've been asked to build a simple application in Java and I decided that this was the best opportunity to finally try out JavaFX, the amazing graphics framework to build modern and flexible user interfaces in Java.
In this article I want to share with you the application I've built, because the code can be quickly analyzed to find solutions to some of the common problems that a first-time user of JavaFX might be facing, like:
- Dealing with data collections and TableView / ListView
- Filtering items in a TableView and ListView with a TextBox
- Passing data between two windows
- Switching layout inside the same window / scene
- Using Gson and some tricks to create a file-based persistent db
The application is a simple meetings editor. Every person participating to the meeting can be registered in the software, that can be used to select a random speaker to host the meeting. The speaker must be someone that is present at the moment of the meeting, for this reason a record of every person not attending the meeting is saved prior the selection.
You can find the application code at the following repository: