Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101292

Need a way to set the minimum size of a window

XMLWordPrintable

      The Stage class has a resizable property which can be set to false to prevent the user from resizing the window. But if it is true, the user can set any size at all, even ridiculously small ones. There should be a way to establish a minimum size. From RT-9485, I gather that Glass does have such an API, but I do not see anything in the JavaFX API that would allow it. You can set a minimum size on the Region that is inside the window, but all that does is prevent the Region from shrinking beyond that size. The window can shrink further than that and the unshrunk Region will be clipped inside it. The only solution I have found is to add a listener to Stage.width and .height that sets the width or height back to the minimum value if it goes below. That works, but it produces ugly flickering.

      Of course, feel free to close this issue if there is in fact a way to achieve it with the existing API.

            psafrata Pavel Ĺ afrata
            emcmanuswse Eamonn McManus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: