I have in the main method:
cargarDatos()
: It is responsible for entering data from a .dat file.
Ventana v=new Ventana()
: It is responsible for opening a window with which you enter data. It ends with a defaultCloseOperation: close_on_exit
.
guardarDatos()
: is responsible for saving the data you have entered in the window and saves it in a .dat file.
The problem is that the program does not get to execute the last line because when it closes the window the execution ends. What can I do?