@Override
		public void paintIconAnimated( Component c, Graphics g, int x, int y, float animatedValue ) {
			int w = getIconWidth();
			int h = getIconHeight();

			g.setColor( Color.red );
			g.drawRect( x, y, w - 1, h - 1 );
			g.fillRect( x, y, Math.round( w * animatedValue ), h );
		}
Minimal example for an animated icon.
flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatedIconTest.java