标签: java keyevent
如何检查按下的键是CapsLk。
if(e2.getKeyChar() == ?) { text_area.setText("CapsLk is pressed") }
答案 0 :(得分:2)
if(e2.getKeyCode() == KeyEvent.VK_CAPS_LOCK){ text_area.setText("CapsLk is pressed"); }