Possible Duplicate:
setMaximumSize not working in java
I’ve having trouble with my JFrame subclass. I need to set a Maximum height.
But setMaximumSize does not work. It seems that’s a bug in java (setMinimumSize works). How could prevent a JFrame from getting higher than a given height ?
Use this instead/as well:
In my experience
setPreferredSize(Dimension)takes preference and always works.I usually use all of them anyway:
setMinimumSize(),setMaximumSize(),setPreferredSize()and then
setSize()as well