Open Bunkerbewohner opened 4 years ago
Ah... should have read the rest of the email and try the program first. Nevermind, you already figured that out of course ^^ 💪
Afterthought: I guess my point still stands after all. You could have her select the location of her database file once and just save it. Or does she use an empty one every time?
No, you're right. I like the suggestion of using the AppData :) Just had to hunt down some NPEs and try to handle bad input gracefully first. Thanks again for looking it over!
And no, she shouldn't use an empty one every time ^^ That wouldn't be very useful
ok, added a settings file with default location and update option.
Nice!
https://github.com/archeaopteryx/CASnumber_lookup/blob/8cc21e9840e1b4890e46d43e3899c1548b681f5e/App.java#L91
To save your mum from having to put the .jar and the excel sheet in the same directory, you could just use a file chooser: https://docs.oracle.com/javase/tutorial/uiswing/components/filechooser.html
You also remember the chosen file, in case it's always the same, by saving the path (and any other options you want to remember) to a text file in Window's AppData folder, e.g.: