开发者

Is there any way in Java to enforce a minimum window size?

开发者 https://www.devze.com 2022-12-24 15:14 出处:网络
Is there any way in Java to e开发者_如何学Gonforce a minimum window size? The last article I can find is from 1999, and has some complicated code to mimic the behaviour...

Is there any way in Java to e开发者_如何学Gonforce a minimum window size?

The last article I can find is from 1999, and has some complicated code to mimic the behaviour... http://www.javaworld.com/javaworld/javaqa/1999-10/03-qa-window.html

Surely there is a simple method that can be used?


I usually set the minimum size of a window by setting the minimum sizes of the JComponents inside of the window.

jcomponent.setMinimumSize(Dimension d);

That line of code will limit a component's minimum size.

You can also call setMinimumSize() on the JFrame directly to achieve a similar effect.

0

精彩评论

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