File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes nx:All of URLy Bird 1.1.3 about suncertify.properties JFrame and JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "nx:All of URLy Bird 1.1.3 about suncertify.properties JFrame and JDialog" Watch "nx:All of URLy Bird 1.1.3 about suncertify.properties JFrame and JDialog" New topic
Author

nx:All of URLy Bird 1.1.3 about suncertify.properties JFrame and JDialog

liqun chang
Ranch Hand

Joined: Nov 20, 2003
Posts: 90
Hi:George and Andrew and other experts.

the instruction say.

Your programs must not require use of command line arguments other than the single mode flag, which must be supported. Your programs must not require use of command line property specifications. All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory.


1.My question is the mean of the bold font.Whether its mean is All configuration must be done via a GUI,and All configuration must be persistent between runs of the program.

2.If yes.i will create FileInputStream and FileOutputStream and use System.getProperty("user.dir") and Property class.then load and store the
suncertify.properties file.Whether my method is right?

3.for "persistent" whether its meaning that it must not be changed between
runs of program?

4.From instruction of sun.I will create JDialog object to store and load
suncertify.properties file.but only after the finishing of store file and restart the program,the suncertify.properties can take effect.Is this right?
whether you have other method to do this?
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

1.My question is the mean of the bold font.Whether its mean is All configuration must be done via a GUI,and All configuration must be persistent between runs of the program.

YES. That is to say, when you start the client (or server), you need to provide a GUI for the users to specify which server (IP and Port) to connect with, for networked mode, or which data file (physical file location of the harddisk) should be used, for non-networked mode.

That is to say, since the system can be in 2 modes: network or non-network. If the system currently is networked, you cannot change it to non-network, without restarting the system.


2.If yes.i will create FileInputStream and FileOutputStream and use System.getProperty("user.dir") and Property class.then load and store the
suncertify.properties file.Whether my method is right?

You need to make use of the property file to store the configuration, as required by the instructions.

If it is the first time the user runs the program, you simply return nothing. But if he runs before, and, for example, specify that he connects to server 10.14.222.11 and port 10000, then you need to save these info, and display the previous configuration to him when he runs the system next time.


3.for "persistent" whether its meaning that it must not be changed between
runs of program?

YES. The user cannot change the mode of the system from *standalone* to *network* without restarting the system.


4.From instruction of sun.I will create JDialog object to store and load
suncertify.properties file.but only after the finishing of store file and restart the program,the suncertify.properties can take effect.Is this right?
whether you have other method to do this?

Exactly. I saved the connection info when the user clicks *ok* button in the JDialog box. So, even the system hangs or errors on connection, the info is saved.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
liqun chang
Ranch Hand

Joined: Nov 20, 2003
Posts: 90
Hi:Nicholas thanks for your suggestion.but however i have question.

1.I will create JDialog that has button1(connect) button2(save),field1(host)
field2(port) for network client.

a. When i start the program,the JDialog load the suncertify.properties file to JDialog,if i click button1(connect) then
connect to default host and port(previous saved in suncertify.properties).


b. if i click the button2(save) then will save the configuration to suncertify.properties,when i restart the program use the previous configuration.

c. In the same time if i enter host in field1 and enter port in field2 then click the button1(connect),then i will connect to the new host and port.

Whether my mention is right? please you help me.

2. Or i create JDialog that has loadButton,saveButton,hostField,portField.
when start program it must be load the previous configuration through suncertify.properties file that saved int the disk.If i save the new configuration ,the program must be restarted for using the configuration.
Is this right?
[ May 20, 2004: Message edited by: liqun chang ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: nx:All of URLy Bird 1.1.3 about suncertify.properties JFrame and JDialog