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

Inconsistent Popup window opening and parent/child relationship

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 1.4.2_05
    • client-libs

    Description

      This program first registeres itself as an AWTEventListener and starts
      another Java program (e.g. SwingSet2 demo) passed as a command line
      argument. It then displays message as new windows are opened/closed. It
      also display the name of the menu item and it's ancestor window when
      user clicks on a menu item.

      The following procedure will help us notice this behaviour:

      a) Compile and run this program with the standard
        "SwingSet2 demo as follows:

      c:\>java -classpath ".;%JAVA_HOME%\demo\jfc\SwingSet2\swingSet2.jar"
          DumpWindow SwingSet2

      b) Click on "Themes" (Do not select any of the selection just yet).

         You will see that the program print "Menu: JMenu" and "Window:
         JFrame".

      c) Select any one of the themes, say Aqua.

         The program will print "Menu:JRadioButtonMenuItem" and "Window:
         JFrame".

      d) Now select "File --> About" and click "OK"

      e) Go back to Themes (again do not select any option, just click and
         hold the mouse on "Themes")

         The program will print "Menu: JMenu" and "Window: JFrame"

         **Interestingly** this time, we will see the following event:

      ********

      java.awt.event.WindowEvent[WINDOW_OPENED,opposite=null,oldState=0,newState=0] on
       ###overrideRedirect###
         javax.swing.Popup$HeavyWeightWindow[###overrideRedirect###,213,104,117x152,la
      yout=java.awt.BorderLayout,rootPaneCheckingEnabled=true]

      ******

      which we did NOT see earlier at step b.

      f) Now select any theme, say "Default", now, you will see the program
         will print "Menu: JRadioButtonMenuItem" and "Window:
         Popup$HeavyWeightWindow"

      *NOTE* At step f), the ancestor for "JRadioButtonMenuItem" has CHANGED
      from "JFrame" in step c) to "Popup$HeavyWeightWindow" is step f).

      ---

      Attachments

        Issue Links

          Activity

            People

              peterz Peter Zhelezniakov
              gnagasunsunw Gopinath Nagasundara (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: