@Override
    public void initUI() {
        
      (...) // Adding components to UI

      Button btnStartStop = new Button("Start");
      // Adding listener to start or stop the animation
      btnStartStop.addPressListener(e -> {
        if  (btnStartStop.getText().equals("Start")) {
          restartAnimation();
          btnStartStop.setText("Stop");
        } else {
          MainWindow.getMainWindow().removeUpdateListener(updateListener);
          btnStartStop.setText("Start");
        }
      });

      (...)

      add(btnStartStop, LEFT + this.fmH, AFTER + this.fmH);
        
      (...)
      
    }