Class CredentialDialog.TFKeyListener

  • All Implemented Interfaces:
    java.awt.event.KeyListener, java.util.EventListener
    Enclosing class:
    CredentialDialog

    private static class CredentialDialog.TFKeyListener
    extends java.awt.event.KeyAdapter
    Listener for username and password text fields key events. When user presses Enter: If current text field is empty (or just contains a sequence of spaces), nothing happens (or all spaces become selected). If current text field is not empty, but the next one is (or just contains a sequence of spaces), focuses the next text field. If both text fields contain characters, submits the form by calling owner's CredentialDialog.OKAction.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.JTextField currentTF  
      protected javax.swing.JTextField nextTF  
      protected CredentialDialog owner  
    • Constructor Summary

      Constructors 
      Constructor Description
      TFKeyListener​(CredentialDialog owner, javax.swing.JTextField currentTF, javax.swing.JTextField nextTF)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void keyPressed​(java.awt.event.KeyEvent e)  
      • Methods inherited from class java.awt.event.KeyAdapter

        keyReleased, keyTyped
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent e)
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Overrides:
        keyPressed in class java.awt.event.KeyAdapter