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

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -