0

When I press a button I want a container to move in a direction, and after that to do another move. The problem is that only one move command is executed (the second one).

centerContainer.getElement().<FxElement>cast().setXY(bounds.getX() - compWidth, bounds.getY(), new Fx(800));
centerContainer.getElement().<FxElement>cast().setXY(bounds.getX(), bounds.getY()+500, new Fx(800));

How can I do two moves, one after another ?

Thank you, Horatiu

Horatiu Jeflea
  • 7,256
  • 6
  • 38
  • 67

1 Answers1

0
 Fx fx = new Fx(INTERVAL);
 fx.addAfterAnimateHandler(new AfterAnimateEvent.AfterAnimateHandler() {
 @Override
 public void onAfterAnimate(AfterAnimateEvent event) {
     //second move implementation
   }
 });
Horatiu Jeflea
  • 7,256
  • 6
  • 38
  • 67