@Override
		public float getValue( Component c ) {
			return ((AbstractButton)c).isSelected() ? 1 : 0;
		}
Minimal example for an animated icon.
flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/FlatAnimatedIconTest.java