don't sleep too much

This commit is contained in:
Dmitry Avdeev
2012-09-13 14:14:19 +04:00
parent 330c5bb039
commit e539a90b0a
@@ -163,6 +163,7 @@ public class Splash extends JDialog implements StartupProgress {
private static final class SplashImage implements Icon {
private final Icon myIcon;
private final Color myTextColor;
private boolean myRedrawing;
public SplashImage(Icon originalIcon, Color textColor) {
myIcon = originalIcon;
@@ -170,9 +171,12 @@ public class Splash extends JDialog implements StartupProgress {
}
public void paintIcon(Component c, Graphics g, int x, int y) {
try {
Thread.sleep(10);
} catch (InterruptedException ignore) {}
if (!myRedrawing) {
try {
Thread.sleep(10);
} catch (InterruptedException ignore) {}
myRedrawing = true;
}
myIcon.paintIcon(c, g, x, y);