views:

81

answers:

1

Is there any way in Java to enforce 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?

+5  A: 

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.

jjnguy
Ah, that worked. Strange that all my googling didn't turn that up. Thank you!
waitinforatrain
@wait No problem, glad to help.
jjnguy