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

[macosx] Frame on multi-screen jumps to another monitor on zoom if setMaximizedBounds() is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 10
    • 9
    • client-libs

      Only on OS X the JFrame jumps to another monitor on zoom if setMaximizedBounds() is used.
      Need 2 monitors to reproduce.
      Compile and run the following application that shows a frame.

      FrameJumpingTest.java

      import javax.swing.*;
      import java.awt.*;

      public class FrameJumpingTest {
          public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                  @Override
                  public void run() {
                      JFrame frame = new JFrame("Frame Jumping Test");
                      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                      frame.setBounds(0, 0, 200, 200);
                      frame.setMaximizedBounds(new Rectangle(100, 100, 400, 400));
                      frame.setVisible(true);
                  }
              });
          }
      }

      Toggle zoom button, the frame goes to maximized state using specified bounds.
      Toggle zoom button again, the frame returns to its original state.
      Drag the frame to the second the second monitor.
      Toggle zoom button, the frame jumps to the first monitor.

            mhalder Manajit Halder (Inactive)
            dmarkov Dmitry Markov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: