Issue
DishFormPanelistIdLbl.setText("Panelist ID:");
DishFormPanelistIdTxt.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
DishFormPanelistIdTxtActionPerformed(evt);
}
});
I have here a text label and text field for ID i want to input only numbers in text how is it possible?been trying the sample program un net beans but they dont have such a solution for this problem any help is appreciated
"Update"
What i want here is when i type letter nothing will show but when number then it will show
Solution
What i did is in the design mode i right click the text field > Events > Key > KeyTyped
then in the code i hade something like this
private void DishFormPanelistIdTxtKeyTyped(java.awt.event.KeyEvent evt) {
// TODO add your handling code here:
char enter = evt.getKeyChar();
if(!(Character.isDigit(enter))){
evt.consume();
}
}
i didnt get the solution here in stack but i will link it this is the link
Answered By - Brownman Revival
Answer Checked By - Mildred Charles (JavaFixing Admin)