| Author |
Config Options
|
Kevin Broderick
Ranch Hand
Joined: Jul 19, 2009
Posts: 39
|
|
Hello,
I am inspired by Andrew Monkhouse's example of doing the config so I decided to try and create my configuration dialog like his such that I have a seperate panel holding the configuration options (for database location and port number, depending on the mode) and this panel is embeded on the main dialog.
I just wondering if I should use an observer pattern that he uses on validating the config options or is there another way that's not as complex.
Thanks in advance
Kevin
|
 |
Roberto Perillo
Bartender
Joined: Dec 28, 2007
Posts: 2147
|
|
Howdy, Kevin!
Well champion, here's what I did: for each mode the application can be started, there's one dialog where the user provides specific properties (for more information, please take a look here). These dialogs are displayed to the user before the application starts. After the user presses the OK button, some validation is performed. If everything's ok, these properties are saved in the suncertify.properties file and the main window is displayed. That is, the area where the user provides the properties are separate from the main window.
|
Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
|
 |
Roel De Nijs
Bartender
Joined: Jul 19, 2004
Posts: 3820
|
|
Hi Kevin,
I followed a similar approach as in Andrew's book: I have a panel to enter configuration settings, which is used in the dialog (shown at startup of the client) and in the server window. The panel knows in which mode it is running. Depending on this mode the panel is created and specific validations are executed. So validations are a part of this panel. I don't know if this is different than the approach in Andrew's book, but I do know that the validation was not sufficient.
Kind regards,
Roel
|
SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
|
 |
 |
|
|
subject: Config Options
|
|
|