Esempio n. 1
0
 public void actionPerformed(ActionEvent e) {
   gui.setText("");
   String name = JOptionPane.showInputDialog("Enter Name");
   if (name != null) {
     if (phoneBook.remove(name)) {
       gui.setText("Success! " + name + " removed.");
     } else {
       gui.setText("Failure! " + name + " not found!");
     }
   } else {
     gui.setText("");
   }
 }