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

[macosx] Window with apple.awt.documentModalSheet property is not attached to its owner

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 12
    • Fix Version/s: tbd
    • Component/s: client-libs
    • Labels:
      None

      Description

      The support for “apple.awt.documentModalSheet” property implemented under JDK-8208543 is incomplete. The window with the property “apple.awt.documentModalSheet” set to Boolean.TRUE is not attached to its owner.

      Test case to reproduce the issue:

      import javax.swing.JDialog;
      import javax.swing.JFrame;
      import java.awt.Dialog;
      import javax.swing.JLabel;

      public class DocumentModalSheet {
          public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.setSize(300,300);
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
              JDialog dialog =
                      new JDialog(frame, null, Dialog.ModalityType.DOCUMENT_MODAL);
              dialog.getRootPane().putClientProperty("apple.awt.documentModalSheet",
                                                     Boolean.TRUE);
              dialog.add(new JLabel("Hello world!"));
              dialog.pack();
              dialog.setVisible(true);
          }
      }

      Expected result:
      The dialog appears as a sheet attached to the owner

      Actual result:
      The dialog appears as a sheet but is not attached to the owner and located at the upper-left corner of the screen

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dmarkov Dmitry Markov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: