This article uses SWINGX and timingframework to show how to achieve the fade effect, the procedure is concise and practical, hope to be helpful to everybody.
Using Alphacomposite in swing allows you to set the opacity of the interface, and then work with Javax.swing.Timer to make it easier to fade in. But we need to inherit the specific UI component and rewrite its Paintcomponent method, while also providing a ActionListener implementation for the timer. This is a bit tedious for programmers.
Fortunately, Jxpanel (JPanel subclasses) in Swingx the Setalpha method to set the half transparency, and all UI components in the Jxpanel can be semi-transparent. The animator provided by Timingframework can help us to set the alpha value of Jxpanel in a non-linear way. Therefore, we in the implementation of fade, you can use Jxpanel to replace JPanel, with animator to replace the timer.