开发者

How to set maximum JPanel width but to stay height free to grow?

开发者 https://www.devze.com 2023-02-28 22:46 出处:网络
How to set maximum JPanel width but to stay height free to grow ? ( I can开发者_开发问答not use prefferedSize for strange reason ). Use LayoutManagers.BoxLayout, GridBagLayout, or some other layout wi

How to set maximum JPanel width but to stay height free to grow ? ( I can开发者_开发问答not use prefferedSize for strange reason ).


Use LayoutManagers. BoxLayout, GridBagLayout, or some other layout will allow you to define a single direction of growth for a panel.


One possibility is use MigLayout http://www.miglayout.com/
There you can easily override minimal:prefered:maximal size. And mainly it works properly.

0

精彩评论

暂无评论...
验证码 换一张
取 消