From 8a3696d027e70a999707e3ff9a5c692c562bafa5 Mon Sep 17 00:00:00 2001 From: myk Date: Sun, 17 Mar 2013 10:02:43 +0000 Subject: [PATCH] do first update of operation log after 100ms instead of the usual 500ms --- src/main/java/forge/gui/DialogMigrateProfile.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/forge/gui/DialogMigrateProfile.java b/src/main/java/forge/gui/DialogMigrateProfile.java index d3e9c797d7a..a0560e2a707 100644 --- a/src/main/java/forge/gui/DialogMigrateProfile.java +++ b/src/main/java/forge/gui/DialogMigrateProfile.java @@ -476,6 +476,7 @@ public class DialogMigrateProfile { // update only once every half-second so we're not flooding the UI with updates timer = new Timer(500, null); + timer.setInitialDelay(100); final Timer finalTimer = timer; timer.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { @@ -791,9 +792,10 @@ public class DialogMigrateProfile { // working with textbox text is thread safe _operationLog.setText(""); - // only update the text box once very half second + // only update the text box once very half second, but make the first + // update after only 100ms final long updateIntervalMs = 500; - long lastUpdateTimestampMs = System.currentTimeMillis(); + long lastUpdateTimestampMs = System.currentTimeMillis() - 400; StringBuffer opLogBuf = new StringBuffer(); // only update the progress bar when we expect the visual value to change