diff --git a/platform/core.startup/src/org/netbeans/core/startup/Splash.java b/platform/core.startup/src/org/netbeans/core/startup/Splash.java index 416381f3ee15..fcc45ae7f75f 100644 --- a/platform/core.startup/src/org/netbeans/core/startup/Splash.java +++ b/platform/core.startup/src/org/netbeans/core/startup/Splash.java @@ -300,6 +300,8 @@ private static class Progress { private volatile int barLength = 0; private volatile String text; + private long next; + private void increment(SplashPainter painter, int steps) { if (steps <= 0) { return; @@ -311,12 +313,15 @@ private void increment(SplashPainter painter, int steps) { int bl = painter.bar.width * progress / maxSteps - barStart; if (bl > 1 || barStart % 2 == 0) { barLength = bl; - onEDT(() -> { - /* Don't try to be smart about which section of the bar to repaint. - There can be tricky rounding issues on HiDPI screens with non-integral - scaling factors (e.g. 150%). */ - painter.repaint(painter.bar); - }); + if (next < System.currentTimeMillis()) { + onEDT(() -> { + /* Don't try to be smart about which section of the bar to repaint. + There can be tricky rounding issues on HiDPI screens with non-integral + scaling factors (e.g. 150%). */ + painter.repaint(painter.bar); + }); + next = System.currentTimeMillis() + 50; + } } } } @@ -546,21 +551,17 @@ public SplashPainter(Progress model, Graphics graphics, JComponent comp, boolean } } - long next; final void repaint(Rectangle r) { if (comp != null) { comp.repaint(r); } else { - if (next < System.currentTimeMillis()) { - paint(); - try { - SplashScreen ss = SplashScreen.getSplashScreen(); - if (ss != null) { - ss.update(); - } - } catch (IllegalStateException splashAlreadyClosed) {} - next = System.currentTimeMillis() + 200; - } + paint(); + try { + SplashScreen ss = SplashScreen.getSplashScreen(); + if (ss != null) { + ss.update(); + } + } catch (IllegalStateException splashAlreadyClosed) {} } }