OSDN Git Service

BUGFIX: confirm postion is not save by pushing OK or NG buttion.
authorTakuya Ono <takuya-o@users.sourceforge.jp>
Mon, 20 Aug 2007 15:04:21 +0000 (15:04 +0000)
committerTakuya Ono <takuya-o@users.sourceforge.jp>
Mon, 20 Aug 2007 15:04:21 +0000 (15:04 +0000)
Support: [ #10874 ] Auto timeout confrim.

src/org/jent/checksmtp/ToListUI.java

index 2ce629f..8bb9ac5 100644 (file)
@@ -10,6 +10,8 @@ import java.awt.Dimension;
 import java.awt.Point;
 import java.awt.Toolkit;
 import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
 
 /**
  *
@@ -69,8 +71,19 @@ public class ToListUI extends javax.swing.JFrame {
               frameSize.width, frameSize.height );
     }
     
-    
+    //Auto confirm timer
+    int timeOut = ApplicationProperties.getConfirmTimeout();
+    if ( timeOut > 0 ) {
+      TimerTask task = new TimerTask() {
+        public void run() {
+          jButtonOKActionPerformed(null);
+        }
+      };
+      confirmTimer.schedule(task, timeOut * 1000L);
+    }
   }
+  private static Timer confirmTimer = new Timer();
+  
   
   /** This method is called from within the constructor to
    * initialize the form.
@@ -158,19 +171,21 @@ public class ToListUI extends javax.swing.JFrame {
     );
     pack();
   }// </editor-fold>//GEN-END:initComponents
-
+  
   private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
     restorePosition();
     resultNotify.sayNG();
   }//GEN-LAST:event_formWindowClosing
-    
+  
   private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed
+    restorePosition();
     resultNotify.sayNG();
     this.dispose();
   }//GEN-LAST:event_jButtonCancelActionPerformed
   
   private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed
     //push OK
+    restorePosition();
     resultNotify.sayOK();
     this.dispose();
   }//GEN-LAST:event_jButtonOKActionPerformed