protected Document createDefaultModel() {

		return new PlainDocument() {
			public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {

				char[] old = IntegerTextField.this.getText().toCharArray();
				char[] source = str.toCharArray();
				char[] result = new char[source.length];
				int j = 0;

				for (int i = 0; i < result.length; i++) {
					if (Character.isDigit(source[i])) {
						result[j++] = source[i];
					}
					else if (source[i] == '-' && min < 0) {
						if (old.length > 0 && old[0] != '-') {
							offs = 0;
							result[j++] = source[i];
						}
						else if (old.length == 0) {
							result[j++] = source[i];
						}
					}
				}

				super.insertString(offs, new String(result, 0, j), a);

			}

		};

	}