LoadAnimationPanel loadAnimationPanel = new LoadAnimationPanel();
add(loadAnimationPanel);
loadAnimationPanel.setAnimating(true);
Animator fadeOutAnimator = null;
Animator fadeInAnimator = null;
try {
loadAnimationPanel.setAnimating(false);
fadeOutAnimator = new Animator(400,
new FadeOut(DemoXPanel.this,
loadAnimationPanel, demoPanel));
fadeOutAnimator.setAcceleration(.2f);
fadeOutAnimator.setDeceleration(.3f);
fadeInAnimator = new Animator(400,
new PropertySetter(DemoXPanel.this, "alpha", 0.3f, 1.0f));
TimingTrigger.addTrigger(fadeOutAnimator, fadeInAnimator, TimingTriggerEvent.STOP);
fadeOutAnimator.start();
} catch (Exception ignore) {
if (fadeOutAnimator != null) fadeOutAnimator.stop();
if (fadeInAnimator != null) fadeInAnimator.stop();
if (loadAnimationPanel != null)
loadAnimationPanel.setAnimating(false);
System.err.println(ignore);
ignore.printStackTrace();