I'm building a restaurant system, and I want to give adminstrator a privilege to change and save the settings so that when other users log in, will find new settings.
+2
A:
You can use the java properties api to save any settings as Key-Value pairs.
A tutorial is here http://java.sun.com/docs/books/tutorial/essential/environment/properties.html
This can save your properties as .properties files as well as XML files
Midhat
2009-03-30 08:09:53
+1
A:
You can create a directory to the disk and store files which are looking like
user=Ben
font=arial
...
These file you can read with a java.util.Properties object.
Properties p;
p.load(inStream);
The properties you can add to the system properties and use it in every location of your code by calling
System.setProperty(font, arial);
System.getProperty(font);
Markus Lausberg
2009-03-30 08:12:15
+4
A:
Java has a dedicated preferences API, which is more powerful than using Properties files - that should be exactly what you want. It offers "System" preferences and "User" preferences - presumably the admin would be allowed to change "System" preferences.
Michael Borgwardt
2009-03-30 08:20:29