[求助]keylistener的问题
s=e.getKeyText(e.getKeycode())如果我按下数字1键,那么s为什么不等于"1"
但是 s.equals("1")==true
实在不太明白
版主帮忙看一下
2006-12-27 11:23
2006-12-27 11:33
2006-12-27 11:43
2006-12-27 11:45
2006-12-27 11:52
2006-12-27 11:58
e.getActionCommand()确实可以,它返回的可能是字符串常量池里的字符串
但是为了一致性,判断字符串是否相等,最好还是用 equals

2006-12-27 12:07
2006-12-27 12:12