package net.hexid.jfx;

public class IntegerField extends javafx.scene.control.TextField {
	public IntegerField() {
		super();
	}
	public IntegerField(int num) {
		super(Integer.toString(num));
	}
	public IntegerField(String num) {
		super(num);
	}

	@Override public void replaceText(int start, int end, String text) {
		if(!text.matches("\\D")) super.replaceText(start, end, text);
	}

	@Override public void replaceSelection(String text) {
		if(!text.matches("\\D")) super.replaceSelection(text);
	}

	public int getInteger() {
		return Integer.parseInt(getText());
	}
	public void setInteger(int num) {
		setText(Integer.toString(num));
	}
}
@@ -17,16 +17,56 @@
 d.jfx;%0A%0A
+import javafx.scene.control.TextField;%0A%0A
 public c
@@ -539,147 +539,6 @@
 ;%0A%09%7D
-%0A%0A%09public int getInteger() %7B%0A%09%09return Integer.parseInt(getText());%0A%09%7D%0A%09public void setInteger(int num) %7B%0A%09%09setText(Integer.toString(num));%0A%09%7D
 %0A%7D

Remove unnecessary getter/setter methods