public void undo() {
   frame.setTitle(oldName);
 }
 public void redo() {
   frame.setTitle(newName);
 }