Maybe we want to create a text field to b e filled with numbers. eg in the form of payment there should be a Field Text Input number ( can ...
Maybe we want to create a text field to b e filled with numbers. eg in
the form of payment there should be a Field Text Input number ( can not
be a letter ).
therefore the following ways you should do
1st. Create a textfield
2nd. Right Click -->Events -->Key --> KeyTyped on the text field that you will set to only number available

3rd. Type on textfieldKeyTyped methode
char c=evt.getKeyChar();
if(!(Character.isDigit(c)|| (c==KeyEvent.VK_BACK_SPACE)||c==KeyEvent.VK_DELETE)){
getToolkit().beep();
evt.consume();
}
I show you what's complete code

therefore the following ways you should do
1st. Create a textfield
2nd. Right Click -->Events -->Key --> KeyTyped on the text field that you will set to only number available
3rd. Type on textfieldKeyTyped methode
char c=evt.getKeyChar();
if(!(Character.isDigit(c)|| (c==KeyEvent.VK_BACK_SPACE)||c==KeyEvent.VK_DELETE)){
getToolkit().beep();
evt.consume();
}
I show you what's complete code