CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Moscow, Russia
    Posts
    35

    Capturing Tab-cycle

    How do I capture key events associated with pressing Tab key ?


  2. #2
    Join Date
    Apr 1999
    Location
    Bangalore,India
    Posts
    43

    Re: Capturing Tab-cycle

    Check for KeyEvent.getKeyCode() method returns a int value equal to KeyEvent.VK_TAB.
    Then that event is from the TAB key.
    But in JTextField u won't get the event thrown to your Listeners.Because the processKeyEvent catches it and then do the necessary action in the field and won't send this to the listeners.
    So if u want to othere processing than the default one provided with swing then u have to overide the processKeyEvent(KeyEvent) method of the component.

    Hope this will solve yours.
    regards,
    arun...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured