Java Netbeans Textfield Nur Zahlen

//Use in swing java key type and write this
char c = evt.getKeyChar();
        if(!Character.isDigit(c)){
            evt.consume();
        }
Mushy Manatee