Do I must use the Property class? Or use the XML file to store the configuration file?
God, no!!!
About this requirement, you need to have a suncertify.properties file in the current working directory. This will store the configuration the users provide when the application starts in the 3 different modes. For instance, I get your runme.jar file and place it in my C:\Jeffry-SCJD directory. I run your file with
java -jar runme.jar server. Since there isn't still a suncertify.properties file in the C:\Jeffry-SCJD directory, your application will create the file there. But what should be stored there? For instance, in my case, for the server initialization, I ask the user to provide the port number and the database location. Remember that, at this point, I'm starting the server, so clients can connect to it. When the user provides these information, I store these information in the suncertify.properties file in the current working directory (System.getProperty("user.dir")). I used the java.util.Properties class to store the properties, then java.io.FileInputStream to physically store them. Then, the next time the user starts the application in server mode, the fields of the configuration window will already be filled with the options the user provided the last time the application was started in server mode. Each initialization mode (identified by the parameter in the command line) has its own fields. These fields are the ones you judge necessary to start your application.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD