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

PIT: Child dialog inherits the wrong icon from the parent frame if the parent is LAF decorated

    Details

      Description

      I have created a JFrame after calling setDefaultLookAndFeelDecorated(true). This turns off the native decoration and uses the decoration provided by the default look and feel. I have called JFrame.setIconImages() with 2 images (duke.gif and sun.gif). I expect the JFrame to pick up the right one depending on the image dimensions. I see 2 issues here -

      1. JFrame picks up duke.gif as the icon on the title bar. But when I maximize the frame, I could see sun.gif appearing on the title bar momentarily. When I use the native decoration for the JFrame, it picks up sun.gif and not duke.gif. Hence LAF decoration is not consistant with native decoration with respect to choosing the right icon.

      2. I am creating a child dialog and showing it on the screen. The child dialog is supposed to inherit the icon from the parent. In this case, I expect the child dialog to show duke icon on the title bar. But it shows the sun logo icon which is not being used currently by the parent frame. This is confusing.

      Frame and Dialog must be consistant in what icon they use for the title bar. I think the default look & feel decoration should also be consistant with native decoration with respect to the title bar icon, as long as the platform is same.

      This is reproducible only on the AWT PIT build for b85. This is a new feature introduced in b85 PIT. The above behaviors are noticed on WinXP. On the latest promoted build, we could pass only one image and hence this behavior is not seen. Hence this is specific to the PIT build.

      I have attached a sample test. Execute the sample test. You would see a duke image on the title bar. Maximize the frame. You would see sun logo icon momentarily when the frame maximizes. Click on the button. A dialog will open up. If the dialog's icon does not match with Frame's icon, the bug is reproduced.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bchristi Brent Christian
                Reporter:
                pmohansunw Praveen Mohan (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: