JDK-8089456 : CONSTRAINED_RESIZE_POLICY sometimes ignored when setMaxWidth is used
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: fx2.0.2,fx2.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2012-05-24
  • Updated: 2023-01-05
  • Resolved: 2023-01-05
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.
Other
tbdResolved
Related Reports
Blocks :  
Duplicate :  
Description
Full description of the issue + sample code here: http://stackoverflow.com/questions/10716811/tableview-does-not-always-resize-the-columns
In summary, in a TableView using the CONSTRAINED_RESIZE_POLICY policy, when setMaxWidth is applied to columns and the window is maximised then restored to original size, the policy is not applied any longer.

It seems that because the setMaxWidth prevents the policy to be applied when the window is maximized, the columns are not resized any longer when the window is restored to its original size.
Comments
This issue is fixed by JDK-8293119. With JDK-8293119, the CONSTRAINED_RESIZE_POLICY honors the columns' maximum widths and handles resizing correctly.
05-01-2023

Cannot reproduce with jfx18 on Mac OS X as described, though it does exhibit weird behavior when min width is set in the last column - see attached video.
26-08-2022

To be more precise, the setMaxWidth must not be applied to the last column of the table, it is ok to use it in other columns. The issue arises when the column you want to fully auto-size to adjust is not the last column.
24-05-2012