只有输入完了,在检查,不对就提示用户重新输入
String s=textField.getText();
int index=s.indexOf("&");
if(index!=-1)
{
  //提示输入不合法
}