Ejemplo n.º 1
0
  public void actionPerformed(ActionEvent evt) {
    String userChoice = evt.getActionCommand();
    if (userChoice == "write") action = myDuke.write();
    else if (userChoice == "think") action = myDuke.think();
    else if (userChoice == "wave") action = myDuke.wave();

    repaint(); // if a different choice has been made, call our paint through repaint()
  }