This week's book giveaways are in the Cloud and AI/ML forums. We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line! See this thread and this one for details.
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?