@Override
    public void setSize(int size) throws Exception {
        if (size <= 0) {
            throw new Exception("size must be greater than zero.");
        }

        this.size = size;
    }
<code>setSize</code> sets the size of the terrain where the area is
size x size.

@param size
           the new size of the terrain.
@throws Exception 

@throws Exception
            if the size is less than or equal to zero.
jme3-terrain/src/main/java/com/jme3/terrain/heightmap/AbstractHeightMap.java