You can set a JFrame's minimum size via setMinimumSize, but this doesn't work (as far as I know for maximum size). If you absolutely need maximum size, then you can use a ComponentListener similar to this one: