you limited minimum size of board by `setMinimumSize` and `pack` can't make smaller board then you set there also `pack` make bigger board if there will be more fields then 5x5, it doesn't matter what had you set in `setMinimumSize`. Try to remove it and say is there any difference.