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

requestFocus() on a frame does not work (1.1.x only)

    Details

    • Subcomponent:
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_2.5

      Description

      Calling requestFocus() on a Frame after all the components have been added to
      it and the frame is visible does not give the frame the focus. HJ browser uses
      EditorFrame which is an extension of Frame. At the end of initFrame(), we do
      a requestFocus(). When we check for FocusOwner via the getFocusOwner() call,
      we get back null. This implies that keyEvents are not propogated to the frame
      correctly. I also tried to use windowActivated() from the WindowEvent
      as well as componentShowing() of the ComponentEvent to use as entry
      points for requestFocus, with no success.

      I notice that a piece of code in Window.java is commented out for handling the WindowEvent.ACTIVATED. There is some mention of this messing up focus
      on solaris.
      As a workaround in our HJ code, I now force the textfield to have focus. The
      EditorFrame needs to have focus assigned to it as users might use action keys as soon as the frame comes up (eg: PAGEUP, PAGEDOWN ...)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                son Oleg Sukhodolsky (Inactive)
                Reporter:
                mminasan Malini Minasandram
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: