Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4985406

REG:Window components does not receive key events even when they have focus

XMLWordPrintable

    • b51
    • x86
    • windows_xp
    • Verified

      I am creating a frame & a window and making this frame as the parent of the window. Frame and Window contain a button component each. I have added the focus listener to the components and window focus listeners to the window and frame. When the application launches, the focus is given to the button on the window. This button is supposed to dispose the window itself when clicked. On Win32, when I press space bar, no action event is triggered by the button on the window. On the console, the respective focus listeners show that this button is having focus and this window is the focused window. I am able to see the button being pressed visually when I press space bar and somehow, the key event is not getting delivered to the component. When I click the button with the mouse, it works fine.

      This is noticed only from 1.4.2 on win32 alone and this application works fine on other platforms. I am able to reproduce this with Tiger-beta2-b35. I tested this with Win XP Pro.

      I have attached a sample test. Execute the test. You would see a window and a frame on the screen, each of them having a button. Check whether the focus is in 'Dispose' button on the window. If not, click the 'Show' button on the frame. Once Dispose gains focus, press the space bar. If you notice the button being visually pressed and if the window still remains, the bug is reproduced.

            dcherepanov Dmitry Cherepanov
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: