IntegerField (@Nullable String valueName, int minSize, int maxSize, int defaultValue) { IntegerField field = new IntegerField(valueName, minSize, maxSize); field.setDefaultValue(defaultValue); field.setColumns(4); if (defaultValue < 0) field.setCanBeEmpty(true); field.setMinimumSize(field.getPreferredSize()); return field; }