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

Focus does not move from one to another internalFrame when pulldown menu is open

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • client-libs

      Two InternalFrames show up.
      When we input some characters in one InternalFrame and open the pull down
      menu. Then we click another internalFrame to move the focus and input
      characters, the characters does not appear in the latter internalFrame.
      Those shows up in the former internalFrame.
      This seems that the focus does not move when pull down menu stay open.

      REPRODUCE:
       1) Compile the attached test programs.
       2) Invoke "Java TestFrame"

          Although we can see only one InternalFrame, this program shows
          2 InternalFrames.
          One is "InternalFrame1". another is "InternalFrame2" behind the
          InternalFrame1.

       3) Move the "InternalFrame1" in order to show InternalFrame2.
       4) Press some key and you will see a character which you input.
       5) Click "menu" in InternalFrame1
       6) Click InternalFrame2 while the menu in InternalFrame1 stays open.
       7) Press some key

       Problem:
         We expect that the character appears in the InternalFrame2,
         but it does in InternalFrame1.
         This does not seem that the focus does not move correctly while
         menu is opening.


      CONFIGRATION:
       OS : WindowsXP(SP1, Japanese)
       JRE : 1.4.1_05/1.4.2fcs/1.5b17



      NOTE:
       The followings are the report from the user.

      ===>
      We tracked the program flow in the test program.

      Usually the focus moves from Frame1 to Frame2,

       Mouse click -> evevt occurs -> draw something in Frame2
       -> execute internalFrameActivated()

      However, when the menu in InternalFrame1 is opening,
      the program flows,

       Mouse click -> evevt occurs -> draw something in Frame2
       -> execute internalFrameActivated()
       -> Close Frame1

      As to the "close Frame1", we found the code in
       javax.swing.plaf.basic.BasicPopupMenuUI$MenuKeyboardHelper.removeItems.

              if (lastFocused != null) {
                              lastFocused.requestFocus();
              }

      The lastFocuses has the Object which had the focus just before the menu in
      internalFrame1 was opened.(which is, Jpanel in Frame1)

      We cosider the following scenario.

      In the above "close Frame1", the program retrieves the focus again
      which once moves to Jpanell of Frame2.

      <=======


      ============================================================================



            kizune Alexander Zuev
            tbaba Tadayuki Baba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: