|
Duplicate :
|
|
|
Relates :
|
|
|
Relates :
|
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.
|