Search code examples
javaswinganimationfading

Java Swing: is there a standard fading rate?


At the moment, I'm fading components in/out at a rate of 0.1 alpha/second. I've read some examples online that use 0.03 alpha/second. Is there a standard rate at which components should fade in/out? Is there a standard transition animation rate?


Solution

  • I don't believe that such a standard exists and will ever exist for that reasons :

    • It is mostly subjective
    • It depends on the speed of the application. If your application is slow you would rather put a slow effect in order to comply with the rest or mask the slowness
    • It depends on what's inside your components. For example it makes sense that a growl notification will fade slowly while an alert box will fade quickly once you click on "ok"
    • Fading is just an effect it won't affect your user so much as long as it doesn't affect the functional experience (like for example a looong fading that avoids you to use other fonctionality while it is happening).