-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JFrame cannot be resized narrower than the width required to accommodate its title #351
Comments
I was just trying it out, here is the narrowest one of my components gets with FlatLAF: Here is the narrowest it gets when using Nimbus as the underlying LAF: I'm speculating the title is the problem since the width happens to be just right to accommodate the title. The panel within the frame uses TableLayout but the frame uses BorderLayout with the panel added at CENTRE. |
I see! So you have some code in your app that prevents resizing window smaller than preferred (or minimum) size of components, right? And because the window title in FlatLaf is also implemented in Swing, and has some preferred/minimum size, it prevents smaller window width. |
Sort of. getMinimumSize is overridden for the panel within the frame based on component sizes in the panel, but not for the frame itself. The minimum for the frame is set based on using frame.pack(). I think the problem is that frame.pack() is adjusting the frame's size to accommodate its own title rather than to accommodate the components within it. I'm not sure that really respects the contract for pack(), since I wouldn't have said a frame's title constitutes a subcomponent:
|
…en calculating preferred/minimum width of window (issue #351)
Should be fixed in main branch. |
That fixed it, thanks! |
A width-resizeable JFrame cannot be resized narrower than the width required to accommodate its title (flatlaf-1.3).
The text was updated successfully, but these errors were encountered: