public void fadeBackgroundIconColorFromTransparentToOpaque ( final int cycleCount ) { stopBackgroundIconColorFadeAnimation ( ) ; backgroundIconColorFadeAnimation = Animations . createFadeTransition ( backgroundIcon , JFXConstants . TRANSPARENCY_FULLY , JFXConstants . TRANSPARENCY_NONE , 1 , JFXConstants . ANIMATION_DURATION_FADE_SLOW ) ; backgroundIconColorFadeAnimation . setOnFinished ( event -> backgroundIcon . setOpacity ( JFXConstants . TRANSPARENCY_NONE ) ) ; backgroundIconColorFadeAnimation . play ( ) ; }
Apply and play a FadeTransition on the icon in the foregroundIcon . This Transition modifies the opacity of the foregroundIcon from fully transparent to opaque .