Window.preferredSize

Dimension preferredSize

Description

The preferred size of the window.

Used in automatic layout and resizing. To set a specific value for only one dimension, specify the other dimension as -1.