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

REG:Calling setVisible of a non-focusable window removes focus from the parent

XMLWordPrintable

    • b41
    • sparc
    • solaris_9

      I am creating a class by extending java.awt.Frame and creating an empty window inside the class. I am making the frame as well as window visible. Frame has a button which would call window.setVisible() when clicked. Window is a non-focusable window since it does not have any component in it. Now when I click the button, it calls setVisible() again on the already visible window. But as soon as the button is clicked the frame loses the focus, on solaris9-CDE. Frame & button trigger focus lost events respectively. I am not quite sure where does the focus go (It does not go to window either). Frame is not supposed to lose the focus when making a non-focusable window visible.

      This is noticed right from Tiger-beta-b19 on Solaris9-CDE. On Win32, it works fine. On the previous builds, the frame loses focus but gains it back almost immediately on the same Solaris-CDE.

      I have attached a sample test. Execute the sample test. You would see a frame and a window. Click the 'Show' button on the frame. If the button and the frame loses focus, the bug is reproduced.

            dav Andrei Dmitriev (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: