public void actionPerformed(ActionEvent e) {
    String ac = e.getActionCommand();
    if (ac.equals("gotoStart")) {
      pauseButton.doClick();
      gotoStart();
      update();
    } else if (ac.equals("stepBack")) {
      pauseButton.doClick();
      stepBack();
      update();
    } else if (ac.equals("playBack")) {
      lastFrameTime = System.currentTimeMillis();
      playBack();
      updateLastClicked((JButton)(e.getSource()));
    } else if (ac.equals("pause")) {
      pause();
      updateLastClicked((JButton)(e.getSource()));
    } else if (ac.equals("playForward")) {
      lastFrameTime = System.currentTimeMillis();
      playForward();
      updateLastClicked((JButton)(e.getSource()));
    } else if (ac.equals("stepForward")) {
      pauseButton.doClick();
      stepForward();
      update();
    } else if (ac.equals("gotoEnd")) {
      pauseButton.doClick();
      gotoend();
      update();
    } else if (ac.equals("animTick")) {
      animate();
    } else {
      // TODO: Error? Idk.
    }
  }