Try something like this. There is a line in "a.config" text file in
the directory where the program was started that contains
NewDraw3.version=1.0
this is standard keyword=value notation
(I edited out some code so I hope there are no typo's)
HTH
Phil...
-----------------------------------------------------------------
import java.util.Properties;
Properties useropt, sysProps;
sysProps = System.getProperties();
homeDir = sysProps.getProperty("user.dir", null);
// user properties
fn = "a.config"; // filename hardwired
useropt = new Properties();
configfile = new File(homeDir, fn);
try {
useropt.load(new FileInputStream(configfile));
} catch (IOException e) {
System.out.println("Warning -- config file not found -- ");
}
useropt.getProperty("NewDraw3.version","1.0");
-----------------------------------------------------------------
"¤H" <re****@hongkong.com> wrote in message news:bg**********@adenine.netfront.net...
Normally we specify the properties for 'java' by the -D option. Is there
any alternatives, say reading a property file, rather than manually typing
all the properties one by one. I searched through the SDK documentation but
there wasnt anything mentioned.
I suspect there should be some ways. Any hints appreciated.
---
Posted via news://freenews.netfront.net
Complaints to ne**@netfront.net