Question about Dialog windows and files
making a program that presents a GUI menu to the user which gives options to add or delete records of books from a library. Each button opens up a corresponding Dialog window where they enter details and click submit which then saves the details to an external file.
my question is quite general - My constructor for the main menu Frame reads the records from the file and stores them in an ArrayList as soon as the program is loaded, then when a dialog window is opened i have a save button which invokes a method which adds the details to the ArrayList, saves the details to the file, closes the file and closes the dialog window. Is the file now closed permanently to the program, or does closing the dialog window kind of refresh or reload the main menu frame so that the file would be open again?
Im thinking if the first option is true it doesn't make sense to read the file in the constructor for the main menu - I may as well only load it when one of the dialog windows is called.