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

problems with Canvas subclass and gotFocus()/lostFocus()

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0.2
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Verified

      Description

      See bug 1239622 for testcase.

      <Running under CDE>
      Run appletviewer on bug.html. An applet containing 3 buttons will come up.
      Click on "awt but 1", then slowly move the mouse over and around in the
      first button (the custom imagebutton). It doesn't appear to receive focus,
      or at least gotFocus() is not called (I have a println in this method).
      Now move the mouse out of the applet window, and quickly move the mouse
      into the appletwindow so that your mouse stops on the imagebutton. Notice
      that it gets a black motif-focus rectangle, and your xterm should also display
      some message indicating that gotFocus() was called. (You may have to try it
      a few times).

      This gives the appearance of 2 buttons having the current focus. Why does the Canvas
      receive gotFocus() events when the mouse is moved from the outside, but not when its
      moved around within the applet window. Note that clicking on "awt but 2" and then
      hitting TAB correctly (I assume) moves the focus to the image button and generates the
      correct event.

        Attachments

          Activity

            People

            • Assignee:
              amfowler Anne Fowler (Inactive)
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: