JDK-8158918 : setExtendedState(1) for maximized Frame results in state==7
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2016-06-07
  • Updated: 2016-08-11
  • Resolved: 2016-07-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b131Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
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.


Comments
this is regressin of JDK-8037575
10-06-2016

RULE "java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java" Exception java.lang.RuntimeException: getExtendedState() != ... as expected.
07-06-2016