Java Utililty Methods JDialog Fade

List of utility methods to do JDialog Fade

Description

The list of methods to do JDialog Fade are organized into topic(s).

Method

voidfadeIn(final JDialog dialog)
Creates an animation to fade the dialog opacity from 0 to 1.
final Timer timer = new Timer(10, null);
timer.setRepeats(true);
timer.addActionListener(new ActionListener() {
    private float opacity = 0;
    @Override
    public void actionPerformed(ActionEvent e) {
        opacity += 0.15f;
        dialog.setOpacity(Math.min(opacity, 1));
...
voidfadeIn(final JDialog dialog, int delay, final float incrementSize)
Creates an animation to fade the dialog opacity from 0 to 1.
final Timer timer = new Timer(delay, null);
timer.setRepeats(true);
timer.addActionListener(new ActionListener() {
    private float opacity = 0;
    @Override
    public void actionPerformed(ActionEvent e) {
        opacity += incrementSize;
        dialog.setOpacity(Math.min(opacity, 1)); 
...
voidfadeInAndOut(final JDialog dialog)
Creates an animation to fade the dialog opacity from 0 to 1, wait at 1 and then fade to 0.
fadeInAndOut(dialog, 50, 0.05f, 10000);