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

[macos] if JFrame is maximized on OS X, all new JFrames will be maximized by default

    XMLWordPrintable

    Details

    • Subcomponent:
    • Introduced In Version:
      9
    • Resolved In Build:
      b05
    • CPU:
      x86
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      OS X 10.12.6

      A DESCRIPTION OF THE PROBLEM :
      Under Java 9, once a JFrame is maximized, any new JFrames that are open default to maximized. This was not the behavior under Java 8 and earlier.

      REGRESSION. Last worked in version 8u152

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run program on OS X. Maximize the window. Push the button.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect the new JFrame to open unmaximized.
      ACTUAL -
      The new JFrame opens maximized.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.event.*;

      public class FrameBug {

         public static void main(String[] args) {
            SwingUtilities.invokeLater(
               new Runnable() {
                  public void run() {
                     go();
                  }
               });
         }

         public static void go() {
            final JFrame frame = new JFrame();
            JButton button = new JButton("Open Frame");
            frame.getContentPane().add(button);
            button.addActionListener(
               new ActionListener() {
                  public void actionPerformed(ActionEvent e) {
                     JFrame f = new JFrame();
                     f.setSize(400, 400);
                     f.setVisible(true);
                  }
               });
            frame.setSize(500, 500);
            frame.setVisible(true);
         }
      }
      ---------- END SOURCE ----------

        Attachments

        1. 9vs8.png
          9vs8.png
          9 kB
        2. FrameBug.java
          0.8 kB

          Activity

            People

            Assignee:
            mhalder Manajit Halder (Inactive)
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: