Java Swing - KeyListener -
How do I know that when the key is typed, my text changes? Or if the key is a four?
Three ways in the interface KeyListener :
zero Type Key (KeyEvent)
Zero Key Pressed (Key Event)
Zero Key Relayed (Key Event)
So, if you like KeyEvent object:
if ("a" .equals (KeyEvent.getKeyChar ()) is System.out.println ("this is a letter")
Comments
Post a Comment