static void animateBounds(final JComponent c, final Rect a, final Rect b) { animateBounds(c, a, b, 1); } static void animateBounds(final JComponent c, final Rect a, final Rect b, final double seconds) { final long startTime = sysNow(); awtEvery(c, 20, func { double s = msToSeconds(sysNow()-startTime)/seconds; if (s >= 1) { setBounds(c, b); false; } setBounds(c, blendRects(a, b, s)); null; }); }