Results 1 to 3 of 3
- 03-18-2011, 10:45 PM #1
Member
- Join Date
- Mar 2011
- Location
- Cardiff
- Posts
- 3
- Rep Power
- 0
Question about Dialog windows and files
Hi guys,
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.
Any Ideas?
Cheers :)
- 03-19-2011, 01:14 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Depends on how you implement.
Say you are doing write to file periodically, then opening and closing file rises performance issues. If not best thing have to do is, open the file do the stuff write into it and close.
If you could show us what you've done so far we can comment easily.
- 03-19-2011, 01:17 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Read the following for more information that you may really important.
Articles: Tuning Java I/O Performance
Similar Threads
-
Parsing lnk files in windows
By raysod in forum Advanced JavaReplies: 2Last Post: 11-05-2010, 06:39 PM -
2 Part question about cfg xml and dat files
By Samgetsmoney in forum New To JavaReplies: 0Last Post: 02-18-2009, 02:36 AM -
[SOLVED] Using dialog boxes and switch statements question
By hungdukie in forum New To JavaReplies: 2Last Post: 11-22-2008, 05:30 AM -
[SOLVED] JOptionPaneMessage dialog question
By blueyan in forum New To JavaReplies: 2Last Post: 09-28-2008, 07:50 AM -
Opeing multiple pdf files in different acrobat reader windows
By shweta.ahuja in forum Web FrameworksReplies: 2Last Post: 05-07-2008, 12:33 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks