A textbox class only accept integers in Java
问题 I just want to do a textbox class only accepts integers.. I have done something, but ı think it's not enough. Can anyone help me, please? Thanks... import java.awt.TextField public class textbox extends TextField{ private int value; public textbox(){ super(); } public textbox(int value){ setDeger(value); } public int getValue() { return value; } public void setValue(int value) { this.value = value; } } 回答1: I think you are missing the point here's a hint, with your code i can still call