Hell, it is about 5 years ago I posted on this forum and haven't done any
Java programming since 2 years....
But I have a new project again, and a very trivial problem.
I work on a program with a Swing GUI, and according to the guidelines, I start the GUI in the event dispatch
thread. My main class is not GUI aware, I consider it as good practice to have aa non-Swing aware main class but maybe this idea is a bit obsolete...
Not very special, the issue is that the constructor of the main class returns immediately and the main object gets out of scope. Even the main() methods returns immediately so the main thread ends.
So there is not really a good place to place code to save the property file when the aplication is closed. Is the finalize() method maybe a good location? I do not think so, nor do I think the reading and writing of the property file belongs in the GUI classes.... In each case the reading and writing of the property file shoud occur in the same class I guess.
Obviously this is a trivial problem and solved more than a thousand times
What do I miss here?
REgards, Klaas