0
我想取消長期文本框按鍵事件,使用戶重新被按壓的字符不是在文本框中取消按鍵事件在GWT
longBox_1.addKeyPressHandler(new KeyPressHandler(){
@Override
public void onKeyPress(KeyPressEvent event) {
String Valid="1234567890";
if (!Valid.contains(String.valueOf(event.getCharCode()))) {
// the code to cancel the event to be placed here
}
}
});