Saving a JavaFX form


There is a small application written with JavaFX and FXML. It adds fields to the listView.

Question: is it possible to save the fxml file so that the added fields remain?

That is, the question boils down to whether it is possible to get the modified fxml of the form and replace the old one with it?


Yes, you can.

The idea is that you need to display data in a listView that can be serialized. On closing (or at what point you need to save the form), you must serialize your entire form (fxml is easy to serialize, this is a normal xml) and your data from the listView .

Scroll to Top