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

setExtendedState(1) for maximized Frame results in state==7

XMLWordPrintable

    • b131
    • windows

      On Windows, run this code:
                  Frame frame = new Frame("frame");
                  frame.setBounds(100,100, 200,200);
                  frame.setVisible(true);
                  frame.setExtendedState(Frame.MAXIMIZED_BOTH);
                  frame.setExtendedState(Frame.ICONIFIED);
                  System.out.println("Extended state: "+frame.getExtendedState());

      The functionality works fine, Frame will be iconified, but the final extended state will be MAXIMIZED_BOTH | ICONIFIED, not just ICONIFIED.
      This seems to be a regression from JDK-4977491 fixed in JDK 7. Argumentation there was "... setExtendedState() should just set provided state, do not try to combine
      it with current state." -- which sounded reasonable and was implemented if I read java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java right.

            rchamyal Rajeev Chamyal (Inactive)
            yan Yuri Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: