Or to put it another way, the code you would write could possibly be embedded into a JavaFX GUI, but that part is irrelevant to the file-changing code.
A Hibernate.cfg file (not the XML version, right?) is a standard Java properties file. So you could write code which reads the file into a Properties object, modify the relevant properties from (presumably) data from the GUI, and then write the modified Properties object back to the file.
But you could just as well use a text editor to do that. So... what Claude said. Why?