posted 18 years ago
hey, I'm working on a database for a school project and I want to read and write to a file to load/save my information. Now I don't want the file to be one thats address is provided by the user but instead, one that is in a desired location of mine... sort of. Maybe it would be easier to explain another way. I want to save all information to a file called "RunnerStored.txt" that would be located in the folder with the program. The code I used for this feature is
and is written in a JFrame. Now the code works fine and gives me the address of the desired file. However, when the file does not exist, it simply returns null. So to make my question shorter, how can I get the address of the folder that my program is in? Thanks a lot.