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

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -