Lumos
Lumos

Reputation: 13

One-time Java Configuration file on a desktop app

I am doing now a desktop app like a organizer. When the program starts, it has 0 tasks, obviously. I go adding more tasks, but when I close the program and then restart it, all the tasks I have done will be on null.

I think I can use a file that the program will consult. This file will have all the relevant information for load all the tasks.

But, and problem comes here, I want to make a question like "Where do you want to save the configuration file?" It is like Eclipse`s message at start with the workspace. The idea is that the message will only be show until the user specify a valid route.

Can we do this in Java?

Upvotes: 1

Views: 64

Answers (1)

hoat4
hoat4

Reputation: 1212

Use java.util.prefs.Preferences: https://docs.oracle.com/javase/8/docs/api/java/util/prefs/package-summary.html

Upvotes: 1

Related Questions