//Required by ActionListener.
public void actionPerformed(ActionEvent e) {
String name = employeeName.getText();
//User didn't type in a unique name...
if (name.equals("") || alreadyInList(name)) {
Toolkit.getDefaultToolkit().beep();
employeeName.requestFocusInWindow();
employeeName.selectAll();
return;
}
...
}
beep()发出 哔 的一声...