private int valueValidator(int value, JTextField field) {
        if (!field.equals(minesField) && value < 8) {
            value = 8;
        } else if (field.equals(heightField) && value > 16) {
            value = 16;
        } else if (field.equals(widthField) && value > 30) {
            value = 30;
        } else if (field.equals(minesField) && value < 1 || value > (height * width)) {
            value = 10;
        }

        return value;
    }