JDK-6318090 : PIT: Documentation for pack() method is not updated to reflect the impact of min size
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-08-31
  • Updated: 2017-05-16
  • Resolved: 2011-05-18
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 7 Other
7 b03Fixed OpenJDK6Fixed
Related Reports
Relates :  
Description
The definitions for window.setMinimumSize(), setSize(), setBounds() are updated in the current mustang PIT where the minimum size set by the developer for a window is enforced properly now. A window will not be allowed to be resized smaller than the specified minimum size from Mustang-b51. 

The same definition is applicable for pack() also where window.pack() must actually honor the minimum size specified in the application in the same way as some of the other methods such as setSize() and setBounds(). But currently the CCC request does not say anything about the impact of min size on the pack() method. The method definition for pack() must be updated appropriately defining the impact of setting the minimum size. 

However, this scenario seems to work fine with the current implementation where pack() method honors the min size setting and ensures that the frame is not sized smaller than the min size specified.

The PIT build where these changes are available:
java version "1.6.0-internal"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-internal-java2d_24_aug_2005_05_24-b00)
Java HotSpot(TM) Client VM (build 1.6.0-ea-b48, mixed mode, sharing)

Comments
SUGGESTED FIX $ sccs diffs -C Window.java ------- Window.java ------- *** /tmp/sccs.JRWEJ9 2006-08-18 16:38:48.000000000 +0400 --- Window.java 2006-08-18 13:43:07.000000000 +0400 *************** *** 651,658 **** * and layouts of its subcomponents. If the window and/or its owner * are not yet displayable, both are made displayable before * calculating the preferred size. The Window will be validated ! * after the preferredSize is calculated. * @see Component#isDisplayable */ public void pack() { Container parent = this.parent; --- 651,663 ---- * and layouts of its subcomponents. If the window and/or its owner * are not yet displayable, both are made displayable before * calculating the preferred size. The Window will be validated ! * after the preferredSize is calculated. Size of the frame ! * is automatically enlarged if it is less than ! * the minimum size as specified by previous call to ! * {@code setMinimumSize}. ! * * @see Component#isDisplayable + * @see #setMinimumSize */ public void pack() { Container parent = this.parent;
18-08-2006

EVALUATION Need to update documentation...
23-09-2005