JDK-8364547 : Window size may be incorrect when constrained to min or max
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-08-01
  • Updated: 2025-11-14
  • Resolved: 2025-10-31
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
jfx26 b15Fixed
Related Reports
Relates :  
Relates :  
Description
When using Window.setWidth() or Window.setHeight() the window's size might not change because the platform enforced the min and max sizes. In that case the Window's width and height properties will get out of sync with the window's actual width or height. The properties will reflect the requested dimensions instead of the constrained ones.

This bug is happening on all platforms. Unfortunately with the current bookkeeping it's not easy to fix this in the platform-independent code.

To reproduce, run the attached test case.
Press the "Smaller than Minimum" button twice.
On the second press the window's size doesn't change. The window's width and height properties are incorrect and less than the minimums.
Press the "Larger than Maximum" button twice.
On the second press the window's size doesn't change. The window's width and height properties are incorrect and more than the maximums.

Comments
Changeset: c77c2335 Branch: master Author: Martin Fox <mfox@openjdk.org> Date: 2025-10-31 23:00:10 +0000 URL: https://git.openjdk.org/jfx/commit/c77c2335856a967907aaacc9546f44943c069add
31-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1870 Date: 2025-08-14 16:26:07 +0000
14-08-2025

This bug report only covers Windows and Mac. The Linux code is being updated as part of JDK-8354943. That PR also adds the system tests that exposed this bug on Windows and Mac.
14-08-2025

Able to reproduce on macOS with jfx25
05-08-2025