'configurable jframe elements
I have build a digital clock using Swing JFrame, for now the clock is live but it will always show a set of timezone. Is that possible for me to configure the timezone?
I want to set the timezone, name of the label, show/hide the clock. Is these are possible in executable jar?
Solution 1:[1]
Being a configurable application we have two options
- Database
- File
If it's a small application then choosing a database is completely waste of time and memory. We can achieve the same via writing/reading the file.
Again, if we are packing the configuration.properties or reference file along with our runnable jar. It will fail because all the files within jar are read only, we cannot write into it. So the only possibility is to
create a temp file either in the same location of the jar or in system temp folder
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Praveen Jayapal |
