Ejemplo n.º 1
0
  public void actionPerformed(ActionEvent e) {
    String command = e.getActionCommand();
    if (command.equalsIgnoreCase("Exit")) { // Exits the game
      System.exit(0);
      // MyFrame.screen = "title";
      // MyFrame.once=true;

    } else if (command.equalsIgnoreCase("Submit")) {
      String user = name.getText(); // name of user
      if (user.equalsIgnoreCase("") || user == null) {
        user = "******";
      }
      try {
        Highscore.write(MyPanel.score, user);
      } catch (IOException e1) {
        e1.printStackTrace();
      }
      System.exit(0);
      // MyFrame.screen = "title";
      // MyFrame.once=true;

    }
  }