OSDN Git Service

Support: [ #10874 ] Auto timeout confrim.
authorTakuya Ono <takuya-o@users.sourceforge.jp>
Mon, 20 Aug 2007 15:13:26 +0000 (15:13 +0000)
committerTakuya Ono <takuya-o@users.sourceforge.jp>
Mon, 20 Aug 2007 15:13:26 +0000 (15:13 +0000)
src/org/jent/checksmtp/ApplicationUI.form
src/org/jent/checksmtp/ApplicationUI.java

index 5621344..54adf5a 100644 (file)
@@ -33,7 +33,7 @@
           <Group type="102" alignment="1" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jButtonQuit" linkSize="1" min="-2" max="-2" attributes="0"/>
-              <EmptySpace pref="145" max="32767" attributes="0"/>
+              <EmptySpace pref="190" max="32767" attributes="0"/>
               <Component id="jButtonOK" linkSize="1" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jButtonCancel" linkSize="1" min="-2" max="-2" attributes="0"/>
         <Container class="javax.swing.JPanel" name="jPanelMail">
           <Constraints>
             <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
-              <JTabbedPaneConstraints tabName="Mail">
+              <JTabbedPaneConstraints tabName="&#x30e1;&#x30fc;&#x30eb;" toolTip="&#x30e1;&#x30fc;&#x30eb;&#x95a2;&#x4fc2;&#x306e;&#x8a2d;&#x5b9a;">
                 <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
                   <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jPanelMail.TabConstraints.tabTitle" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
                 </Property>
+                <Property name="tabToolTip" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                  <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jPanelMail.TabConstraints tabToolTip" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+                </Property>
               </JTabbedPaneConstraints>
             </Constraint>
           </Constraints>
             <DimensionLayout dim="0">
               <Group type="103" groupAlignment="0" attributes="0">
                   <Group type="102" attributes="0">
-                      <EmptySpace max="-2" attributes="0"/>
+                      <EmptySpace min="-2" max="-2" attributes="0"/>
                       <Group type="103" groupAlignment="0" attributes="0">
                           <Group type="102" alignment="0" attributes="0">
                               <Component id="jLabel1" linkSize="2" min="-2" max="-2" attributes="0"/>
                               <EmptySpace max="-2" attributes="0"/>
-                              <Component id="jTextFieldReceiverPort" pref="112" max="32767" attributes="0"/>
-                              <EmptySpace max="-2" attributes="0"/>
+                              <Component id="jTextFieldReceiverPort" min="-2" pref="112" max="-2" attributes="0"/>
+                              <EmptySpace pref="45" max="32767" attributes="1"/>
                               <Component id="jCheckBoxEnableRemoteConnect" min="-2" max="-2" attributes="0"/>
                           </Group>
                           <Group type="102" alignment="0" attributes="0">
                               <Component id="jLabel2" linkSize="2" min="-2" max="-2" attributes="0"/>
-                              <EmptySpace max="-2" attributes="0"/>
-                              <Component id="jTextFieldServerHost" pref="170" max="32767" attributes="0"/>
-                              <EmptySpace max="-2" attributes="0"/>
+                              <EmptySpace min="-2" max="-2" attributes="0"/>
+                              <Component id="jTextFieldServerHost" pref="150" max="32767" attributes="0"/>
+                              <EmptySpace min="-2" max="-2" attributes="0"/>
                               <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
+                              <EmptySpace min="-2" max="-2" attributes="0"/>
+                              <Component id="jTextFieldServerPort" pref="36" max="32767" attributes="0"/>
+                          </Group>
+                          <Group type="102" alignment="0" attributes="0">
+                              <Component id="jLabel7" min="-2" max="-2" attributes="0"/>
                               <EmptySpace max="-2" attributes="0"/>
-                              <Component id="jTextFieldServerPort" min="-2" pref="54" max="-2" attributes="0"/>
+                              <Component id="jTextFieldConfirmTimeout" pref="213" max="32767" attributes="0"/>
                           </Group>
                       </Group>
-                      <EmptySpace max="-2" attributes="0"/>
+                      <EmptySpace min="-2" max="-2" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
                           <Component id="jTextFieldServerHost" alignment="3" min="-2" max="-2" attributes="0"/>
                           <Component id="jTextFieldServerPort" alignment="3" min="-2" max="-2" attributes="0"/>
                       </Group>
-                      <EmptySpace pref="58" max="32767" attributes="0"/>
+                      <EmptySpace pref="27" max="32767" attributes="0"/>
+                      <Group type="103" groupAlignment="3" attributes="0">
+                          <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
+                          <Component id="jTextFieldConfirmTimeout" alignment="3" min="-2" max="-2" attributes="0"/>
+                      </Group>
+                      <EmptySpace max="-2" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
                 <Property name="inputVerifier" type="javax.swing.InputVerifier" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
                   <Connection code="new PortNumberInputVerifier()" type="code"/>
                 </Property>
+                <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+                  <Dimension value="[1, 19]"/>
+                </Property>
               </Properties>
             </Component>
             <Component class="javax.swing.JTextField" name="jTextFieldServerHost">
                 <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
                   <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jTextFieldServerHost.toolTipText" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
                 </Property>
+                <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+                  <Dimension value="[1, 19]"/>
+                </Property>
               </Properties>
             </Component>
             <Component class="javax.swing.JTextField" name="jTextFieldServerPort">
                 </Property>
               </Properties>
             </Component>
+            <Component class="javax.swing.JLabel" name="jLabel7">
+              <Properties>
+                <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                  <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jLabel7.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+                </Property>
+              </Properties>
+            </Component>
+            <Component class="javax.swing.JTextField" name="jTextFieldConfirmTimeout">
+              <Properties>
+                <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                  <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jTextFieldConfirmTimeout.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+                </Property>
+                <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                  <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jTextFieldConfirmTimeout.toolTipText" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+                </Property>
+                <Property name="inputVerifier" type="javax.swing.InputVerifier" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+                  <Connection code="new TimeoutNumberInputVerifier()&#xa;" type="code"/>
+                </Property>
+                <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+                  <Dimension value="[1, 19]"/>
+                </Property>
+              </Properties>
+            </Component>
           </SubComponents>
         </Container>
         <Container class="javax.swing.JPanel" name="jPanelLDAP">
           <Constraints>
             <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
-              <JTabbedPaneConstraints tabName="LDAP">
+              <JTabbedPaneConstraints tabName="LDAP" toolTip="LDAP&#x95a2;&#x4fc2;&#x306e;&#x8a2d;&#x5b9a;">
                 <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
                   <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jPanelLDAP.TabConstraints.tabTitle" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
                 </Property>
+                <Property name="tabToolTip" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                  <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jPanelLDAP.TabConstraints tabToolTip" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+                </Property>
               </JTabbedPaneConstraints>
             </Constraint>
           </Constraints>
                               </Group>
                               <EmptySpace max="-2" attributes="0"/>
                               <Group type="103" groupAlignment="0" attributes="0">
-                                  <Component id="jTextFieldAttribute" alignment="0" pref="300" max="32767" attributes="0"/>
-                                  <Component id="jTextFieldBaseDn" pref="300" max="32767" attributes="0"/>
+                                  <Component id="jTextFieldAttribute" alignment="0" pref="297" max="32767" attributes="0"/>
+                                  <Component id="jTextFieldBaseDn" pref="297" max="32767" attributes="0"/>
                                   <Group type="102" alignment="0" attributes="0">
-                                      <Component id="jTextFieldProviderUrl" pref="217" max="32767" attributes="0"/>
+                                      <Component id="jTextFieldProviderUrl" pref="212" max="32767" attributes="0"/>
                                       <EmptySpace max="-2" attributes="0"/>
                                       <Component id="jCheckBoxIsSjis" min="-2" max="-2" attributes="0"/>
                                   </Group>
         <Container class="javax.swing.JPanel" name="jPanelAbout">
           <Constraints>
             <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
-              <JTabbedPaneConstraints tabName="About">
+              <JTabbedPaneConstraints tabName="&#x60c5;&#x5831;" toolTip="&#x3053;&#x306e;&#x30d7;&#x30ed;&#x30b0;&#x30e9;&#x30e0;&#x306b;&#x3064;&#x3044;&#x3066;">
                 <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
                   <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jPanelAbout.TabConstraints.tabTitle" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
                 </Property>
+                <Property name="tabToolTip" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+                  <ResourceString bundle="org/jent/checksmtp/Bundle.properties" key="ApplicationUI.jPanelAbout.TabConstraints tabToolTip" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+                </Property>
               </JTabbedPaneConstraints>
             </Constraint>
           </Constraints>
index 1fbb024..2ae94e9 100644 (file)
@@ -41,6 +41,7 @@ public class ApplicationUI extends javax.swing.JFrame {
     jTextFieldServerHost.setText(ApplicationProperties.getSmtpServerHost());
     jTextFieldServerPort.setText(Integer.toString(ApplicationProperties.getSmtpServerPort()));
     jCheckBoxEnableRemoteConnect.setSelected(ApplicationProperties.getSmtpEnebleRemoteConnect());
+    jTextFieldConfirmTimeout.setText(Integer.toString(ApplicationProperties.getConfirmTimeout()));
     
     jCheckBoxLdap.setSelected(ApplicationProperties.getLdap());
     jTextFieldProviderUrl.setText(ApplicationProperties.getLdapProviderURL());
@@ -67,7 +68,7 @@ public class ApplicationUI extends javax.swing.JFrame {
       if ( !ret ) {
         jTextField.setBackground(Color.PINK);
         if ( portNumberOutOfRangeErrorDialog == null ) {
-          portNumberOutOfRangeErrorDialog = 
+          portNumberOutOfRangeErrorDialog =
                   new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.Port_number_is_integer_from_1_to_65535."),
                   null, MessageDialogUI.WARNING_MODE);
         } else {
@@ -81,6 +82,38 @@ public class ApplicationUI extends javax.swing.JFrame {
     }
   }
   
+  static private MessageDialogUI timeoutRangeErrorDialog = null;
+  class TimeoutNumberInputVerifier extends  InputVerifier {
+    public boolean verify(JComponent jComponent) {
+      JTextField jTextField = (JTextField) jComponent;
+      boolean ret = true;
+      String input = jTextField.getText();
+      
+      try {
+        int timeout = Integer.parseInt(input);
+        checkTimeoutRange(timeout);
+      } catch (Exception e) {
+        ret = false;
+      }
+      
+      if ( !ret ) {
+        jTextField.setBackground(Color.PINK);
+        if ( timeoutRangeErrorDialog == null ) {
+          timeoutRangeErrorDialog =
+                  new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.exception.Timeout_need_to_a_positive_number"),
+                  null, MessageDialogUI.WARNING_MODE);
+        } else {
+          timeoutRangeErrorDialog.setVisible(true);
+        }
+      } else {
+        jTextField.setBackground(Color.WHITE);
+      }
+      
+      return ret;
+    }
+  }
+  
+  
   /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
@@ -97,6 +130,8 @@ public class ApplicationUI extends javax.swing.JFrame {
     jTextFieldServerHost = new javax.swing.JTextField();
     jTextFieldServerPort = new javax.swing.JTextField();
     jCheckBoxEnableRemoteConnect = new javax.swing.JCheckBox();
+    jLabel7 = new javax.swing.JLabel();
+    jTextFieldConfirmTimeout = new javax.swing.JTextField();
     jPanelLDAP = new javax.swing.JPanel();
     jCheckBoxLdap = new javax.swing.JCheckBox();
     jLabel4 = new javax.swing.JLabel();
@@ -136,9 +171,11 @@ public class ApplicationUI extends javax.swing.JFrame {
     jTextFieldReceiverPort.setText(bundle.getString("ApplicationUI.jTextFieldReceiverPort.text")); // NOI18N
     jTextFieldReceiverPort.setToolTipText(bundle.getString("ApplicationUI.jTextFieldReceiverPort.toolTipText")); // NOI18N
     jTextFieldReceiverPort.setInputVerifier(new PortNumberInputVerifier());
+    jTextFieldReceiverPort.setMinimumSize(new java.awt.Dimension(1, 19));
 
     jTextFieldServerHost.setText(bundle.getString("ApplicationUI.jTextFieldServerHost.text")); // NOI18N
     jTextFieldServerHost.setToolTipText(bundle.getString("ApplicationUI.jTextFieldServerHost.toolTipText")); // NOI18N
+    jTextFieldServerHost.setMinimumSize(new java.awt.Dimension(1, 19));
 
     jTextFieldServerPort.setText(bundle.getString("ApplicationUI.jTextFieldServerPort.text")); // NOI18N
     jTextFieldServerPort.setToolTipText(bundle.getString("ApplicationUI.jTextFieldServerPort.toolTipText")); // NOI18N
@@ -149,6 +186,14 @@ public class ApplicationUI extends javax.swing.JFrame {
     jCheckBoxEnableRemoteConnect.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
     jCheckBoxEnableRemoteConnect.setMargin(new java.awt.Insets(0, 0, 0, 0));
 
+    jLabel7.setText(bundle.getString("ApplicationUI.jLabel7.text")); // NOI18N
+
+    jTextFieldConfirmTimeout.setText(bundle.getString("ApplicationUI.jTextFieldConfirmTimeout.text")); // NOI18N
+    jTextFieldConfirmTimeout.setToolTipText(bundle.getString("ApplicationUI.jTextFieldConfirmTimeout.toolTipText")); // NOI18N
+    jTextFieldConfirmTimeout.setInputVerifier(new TimeoutNumberInputVerifier()
+    );
+    jTextFieldConfirmTimeout.setMinimumSize(new java.awt.Dimension(1, 19));
+
     org.jdesktop.layout.GroupLayout jPanelMailLayout = new org.jdesktop.layout.GroupLayout(jPanelMail);
     jPanelMail.setLayout(jPanelMailLayout);
     jPanelMailLayout.setHorizontalGroup(
@@ -159,17 +204,21 @@ public class ApplicationUI extends javax.swing.JFrame {
           .add(jPanelMailLayout.createSequentialGroup()
             .add(jLabel1)
             .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
-            .add(jTextFieldReceiverPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
-            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+            .add(jTextFieldReceiverPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 112, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 45, Short.MAX_VALUE)
             .add(jCheckBoxEnableRemoteConnect))
           .add(jPanelMailLayout.createSequentialGroup()
             .add(jLabel2)
             .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
-            .add(jTextFieldServerHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE)
+            .add(jTextFieldServerHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
             .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
             .add(jLabel3)
             .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
-            .add(jTextFieldServerPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
+            .add(jTextFieldServerPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE))
+          .add(jPanelMailLayout.createSequentialGroup()
+            .add(jLabel7)
+            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+            .add(jTextFieldConfirmTimeout, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE)))
         .addContainerGap())
     );
 
@@ -189,7 +238,11 @@ public class ApplicationUI extends javax.swing.JFrame {
           .add(jLabel3)
           .add(jTextFieldServerHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
           .add(jTextFieldServerPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
-        .addContainerGap(58, Short.MAX_VALUE))
+        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 27, Short.MAX_VALUE)
+        .add(jPanelMailLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+          .add(jLabel7)
+          .add(jTextFieldConfirmTimeout, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+        .addContainerGap())
     );
     jTabbedPane.addTab(bundle.getString("ApplicationUI.jPanelMail.TabConstraints.tabTitle"), jPanelMail); // NOI18N
 
@@ -241,10 +294,10 @@ public class ApplicationUI extends javax.swing.JFrame {
               .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel4))
             .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
             .add(jPanelLDAPLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
-              .add(jTextFieldAttribute, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
-              .add(jTextFieldBaseDn, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
+              .add(jTextFieldAttribute, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
+              .add(jTextFieldBaseDn, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
               .add(jPanelLDAPLayout.createSequentialGroup()
-                .add(jTextFieldProviderUrl, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE)
+                .add(jTextFieldProviderUrl, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 212, Short.MAX_VALUE)
                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                 .add(jCheckBoxIsSjis))))
           .add(jPanelLDAPLayout.createSequentialGroup()
@@ -347,7 +400,7 @@ public class ApplicationUI extends javax.swing.JFrame {
       .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
         .addContainerGap()
         .add(jButtonQuit)
-        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 145, Short.MAX_VALUE)
+        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 190, Short.MAX_VALUE)
         .add(jButtonOK)
         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
         .add(jButtonCancel)
@@ -398,7 +451,15 @@ public class ApplicationUI extends javax.swing.JFrame {
       throw ex;
     }
     boolean enableRemoteConnect = jCheckBoxEnableRemoteConnect.isSelected();
-    
+    int confirmTimeout;
+    try {
+      confirmTimeout = Integer.parseInt(jTextFieldConfirmTimeout.getText());
+      checkTimeoutRange(confirmTimeout);
+    } catch (NumberFormatException nfEx) {
+      jTextFieldConfirmTimeout.setBackground(Color.PINK);
+      throw nfEx;
+    }
+        
     boolean enableLdap = jCheckBoxLdap.isSelected();
     String ldapUrl = jTextFieldProviderUrl.getText();
     String rootDn = jTextFieldBaseDn.getText();
@@ -409,7 +470,8 @@ public class ApplicationUI extends javax.swing.JFrame {
     || !serverHost.equals(ApplicationProperties.getSmtpServerHost())
     || serverPort != ApplicationProperties.getSmtpServerPort()
     || enableRemoteConnect != ApplicationProperties.getSmtpEnebleRemoteConnect()
-    
+    || confirmTimeout != ApplicationProperties.getConfirmTimeout()
+        
     || enableLdap != ApplicationProperties.getLdap()
     || !ldapUrl.equals(ApplicationProperties.getLdapProviderURL())
     || !rootDn.equals(ApplicationProperties.getLdapRoot())
@@ -422,6 +484,7 @@ public class ApplicationUI extends javax.swing.JFrame {
       ApplicationProperties.setSmtpServerHost(serverHost);
       ApplicationProperties.setSmtpServerPort(serverPort);
       ApplicationProperties.setSmtpEnableRemoteConnect(enableRemoteConnect);
+      ApplicationProperties.setConfirmTimeout(confirmTimeout);
       
       ApplicationProperties.setLdap(enableLdap);
       ApplicationProperties.setLdapProviderURL(ldapUrl);
@@ -432,7 +495,7 @@ public class ApplicationUI extends javax.swing.JFrame {
       smtpClient.configChangeNotify();
       if ( !ApplicationProperties.save() ) {
         new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.error.Fail_the_properties_file_save."), null,
-          MessageDialogUI.ERROR_MODE);
+                MessageDialogUI.ERROR_MODE);
       } else {
         iconified();
       }
@@ -442,6 +505,15 @@ public class ApplicationUI extends javax.swing.JFrame {
   }//GEN-LAST:event_jButtonOKActionPerformed
 
   /**
+   * Time out second is need to positive number
+   */
+  private void checkTimeoutRange(final int confirmTimeout) throws NumberFormatException {
+    if ( confirmTimeout < 0 ) {
+      throw new NumberFormatException(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ApplicationUI.exception.Timeout_need_to_a_positive_number"));
+    }
+  }
+  
+  /**
    *  Check port number range. It is unsigned short number.
    *  Argument is port number.
    **/
@@ -514,7 +586,7 @@ public class ApplicationUI extends javax.swing.JFrame {
         TrayIcon trayIcon = new TrayIcon(loadIconImage(),
                 "mdc", popup);
         trayIcon.setImageAutoSize(true);
-        
+       
         MenuItem menuItemOpen = new MenuItem("Properties...");
         menuItemOpen.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
@@ -634,6 +706,7 @@ public class ApplicationUI extends javax.swing.JFrame {
   private javax.swing.JLabel jLabel4;
   private javax.swing.JLabel jLabel5;
   private javax.swing.JLabel jLabel6;
+  private javax.swing.JLabel jLabel7;
   private javax.swing.JLabel jLabelProgramName;
   private javax.swing.JLabel jLabelProgramVersion;
   private javax.swing.JLabel jLabelSfURL;
@@ -643,6 +716,7 @@ public class ApplicationUI extends javax.swing.JFrame {
   private javax.swing.JTabbedPane jTabbedPane;
   private javax.swing.JTextField jTextFieldAttribute;
   private javax.swing.JTextField jTextFieldBaseDn;
+  private javax.swing.JTextField jTextFieldConfirmTimeout;
   private javax.swing.JTextField jTextFieldProviderUrl;
   private javax.swing.JTextField jTextFieldReceiverPort;
   private javax.swing.JTextField jTextFieldServerHost;